fixing linter issues.
This commit is contained in:
parent
d21def7b8d
commit
ae1c33b863
3 changed files with 556 additions and 573 deletions
|
@ -19,8 +19,8 @@ class IncomingMessage extends Readable {
|
||||||
constructor (urlRequest) {
|
constructor (urlRequest) {
|
||||||
super()
|
super()
|
||||||
this._url_request = urlRequest
|
this._url_request = urlRequest
|
||||||
this._shouldPush = false;
|
this._shouldPush = false
|
||||||
this._data = [];
|
this._data = []
|
||||||
this._url_request.on('data', (event, chunk) => {
|
this._url_request.on('data', (event, chunk) => {
|
||||||
this._storeInternalData(chunk)
|
this._storeInternalData(chunk)
|
||||||
this._pushInternalData()
|
this._pushInternalData()
|
||||||
|
@ -59,26 +59,26 @@ class IncomingMessage extends Readable {
|
||||||
return this._url_request.rawResponseHeaders
|
return this._url_request.rawResponseHeaders
|
||||||
}
|
}
|
||||||
|
|
||||||
get rawTrailers() {
|
get rawTrailers () {
|
||||||
throw (new Error('HTTP trailers are not supported.'))
|
throw new Error('HTTP trailers are not supported.')
|
||||||
}
|
}
|
||||||
|
|
||||||
get trailers() {
|
get trailers () {
|
||||||
throw (new Error('HTTP trailers are not supported.'))
|
throw new Error('HTTP trailers are not supported.')
|
||||||
}
|
}
|
||||||
|
|
||||||
_storeInternalData(chunk) {
|
_storeInternalData (chunk) {
|
||||||
this._data.push(chunk)
|
this._data.push(chunk)
|
||||||
}
|
}
|
||||||
|
|
||||||
_pushInternalData() {
|
_pushInternalData () {
|
||||||
while (this._shouldPush && this._data.length > 0) {
|
while (this._shouldPush && this._data.length > 0) {
|
||||||
const chunk = this._data.shift()
|
const chunk = this._data.shift()
|
||||||
this._shouldPush = this.push(chunk)
|
this._shouldPush = this.push(chunk)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_read() {
|
_read () {
|
||||||
this._shouldPush = true
|
this._shouldPush = true
|
||||||
this._pushInternalData()
|
this._pushInternalData()
|
||||||
}
|
}
|
||||||
|
@ -141,7 +141,6 @@ class ClientRequest extends EventEmitter {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (options.path && / /.test(options.path)) {
|
if (options.path && / /.test(options.path)) {
|
||||||
// The actual regex is more like /[^A-Za-z0-9\-._~!$&'()*+,;=/:@]/
|
// The actual regex is more like /[^A-Za-z0-9\-._~!$&'()*+,;=/:@]/
|
||||||
// with an additional rule for ignoring percentage-escaped characters
|
// with an additional rule for ignoring percentage-escaped characters
|
||||||
|
@ -152,7 +151,7 @@ class ClientRequest extends EventEmitter {
|
||||||
throw new TypeError('Request path contains unescaped characters.')
|
throw new TypeError('Request path contains unescaped characters.')
|
||||||
}
|
}
|
||||||
let pathObj = url.parse(options.path || '/')
|
let pathObj = url.parse(options.path || '/')
|
||||||
urlObj.pathname = pathObj.pathname
|
urlObj.pathname = pathObj.pathname
|
||||||
urlObj.search = pathObj.search
|
urlObj.search = pathObj.search
|
||||||
urlObj.hash = pathObj.hash
|
urlObj.hash = pathObj.hash
|
||||||
urlStr = url.format(urlObj)
|
urlStr = url.format(urlObj)
|
||||||
|
|
1096
spec/api-net-spec.js
1096
spec/api-net-spec.js
File diff suppressed because it is too large
Load diff
Loading…
Add table
Reference in a new issue