Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

io.http

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

io.http - npm Package Compare versions

Comparing version 0.0.6 to 0.0.7

2

package.json
{
"name": "io.http",
"version": "0.0.6",
"version": "0.0.7",
"author": "Vitaly Anagorsky <vitaly@anagorsky.com>",

@@ -5,0 +5,0 @@ "dependencies": {

@@ -23,2 +23,3 @@

this.___POST = {}
this.___DELETE = {}

@@ -55,2 +56,10 @@ this.___options = options

delete (api, callback) {
this.___DELETE[api] = callback
return this
}
___listen () {

@@ -62,2 +71,3 @@

.on('close', () => this.___onClose())
.on('error', (error) => this.___onError(error))
.on('listening', () => this.___onListening())

@@ -75,2 +85,8 @@ .on('request', (req, res) => this.___onRequest(req, res))

___onError (error) {
process.nextTick(() => this.emit('error', error))
}
___onListening () {

@@ -107,26 +123,26 @@

const
headers = req.headers
api = href.pathname
const
ip = (
headers['x-forwarded-for'] ||
req.connection.remoteAddress ||
req.socket.remoteAddress ||
req.connection.socket.remoteAddress
)
query = querystring.parse(href.query)
const
host = headers['host']
headers = req.headers
const
protocol = headers['x-forwarded-proto'] || 'http'
host = req.headers['host']
const
api = href.pathname
protocol = req.headers['x-forwarded-proto'] || 'http'
const
query = querystring.parse(href.query)
method = req.method
const
method = req.method
ip = (
headers['x-forwarded-for'] ||
req.connection.remoteAddress ||
req.socket.remoteAddress ||
req.connection.socket.remoteAddress
)

@@ -181,2 +197,8 @@ req.___ = {

___resSetStatus (req, res, status) {
res.writeHead(status || 200)
}
___resSend (req, res, data) {

@@ -206,5 +228,4 @@

res.writeHead(200, {
['content-type']: 'application/json'
})
this.___resSetHeader(req, res, 'content-type', 'application/json')
this.___resSetStatus(req, res, 200)

@@ -223,5 +244,4 @@ if (this.___options.crypto) {

res.writeHead(200, {
['content-type']: 'text/html'
})
this.___resSetHeader(req, res, 'content-type', 'text/html')
this.___resSetStatus(req, res, 200)

@@ -254,5 +274,4 @@ res.end(html)

res.writeHead(302, {
['location']: url
})
this.___resSetHeader(req, res, 'location', 'url')
this.___resSetStatus(req, res, 302)

@@ -259,0 +278,0 @@ res.end()

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc