Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
Handle.prototype.assignClientRequest = function assignClientRequest (req) {
var state = this._spdyState
var oldEnd = req.end
var oldSend = req._send
// Catch the headers before request will be sent
var self = this
// For old nodes
if (thing.mode !== 'modern') {
req.end = function end () {
this.end = oldEnd
this._send('')
return this.end.apply(this, arguments)
}
}
req._send = function send (data) {
this._headerSent = true
// for v0.10 and below, otherwise it will set `hot = false` and include
// headers in first write
this._header = 'ignore me'
Handle.prototype.assignClientRequest = function assignClientRequest (req) {
var state = this._spdyState
var oldEnd = req.end
var oldSend = req._send
// Catch the headers before request will be sent
var self = this
// For old nodes
if (thing.mode !== 'modern') {
req.end = function end () {
this.end = oldEnd
this._send('')
return this.end.apply(this, arguments)
}
}
req._send = function send (data) {
this._headerSent = true
// for v0.10 and below, otherwise it will set `hot = false` and include
// headers in first write
this._header = 'ignore me'
function Handle (options, stream, socket) {
var state = {}
this._spdyState = state
state.options = options || {}
state.stream = stream
state.socket = null
state.rawSocket = socket || stream.connection.socket
state.deceiver = null
state.ending = false
var self = this
thing.call(this, stream, {
getPeerName: function () {
return self._getPeerName()
},
close: function (callback) {
return self._closeCallback(callback)
}
})
if (!state.stream) {
this.on('stream', function (stream) {
state.stream = stream
})
}
}
util.inherits(Handle, thing)
function Handle (options, stream, socket) {
var state = {}
this._spdyState = state
state.options = options || {}
state.stream = stream
state.socket = null
state.rawSocket = socket || stream.connection.socket
state.deceiver = null
state.ending = false
var self = this
thing.call(this, stream, {
getPeerName: function () {
return self._getPeerName()
},
close: function (callback) {
return self._closeCallback(callback)
}
})
if (!state.stream) {
this.on('stream', function (stream) {
state.stream = stream
})
}
}
util.inherits(Handle, thing)