__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
'use strict'
/**
* response.js
*
* Response class provides content decoding
*/
const STATUS_CODES = require('http').STATUS_CODES
const Headers = require('./headers.js')
const Body = require('./body.js')
const clone = Body.clone
/**
* Response class
*
* @param Stream body Readable stream
* @param Object opts Response options
* @return Void
*/
class Response {
constructor (body, opts) {
if (!opts) opts = {}
Body.call(this, body, opts)
this.url = opts.url
this.status = opts.status || 200
this.statusText = opts.statusText || STATUS_CODES[this.status]
this.headers = new Headers(opts.headers)
Object.defineProperty(this, Symbol.toStringTag, {
value: 'Response',
writable: false,
enumerable: false,
configurable: true
})
}
/**
* Convenience property representing if the request ended normally
*/
get ok () {
return this.status >= 200 && this.status < 300
}
/**
* Clone this response
*
* @return Response
*/
clone () {
return new Response(clone(this), {
url: this.url,
status: this.status,
statusText: this.statusText,
headers: this.headers,
ok: this.ok
})
}
}
Body.mixIn(Response.prototype)
Object.defineProperty(Response.prototype, Symbol.toStringTag, {
value: 'ResponsePrototype',
writable: false,
enumerable: false,
configurable: true
})
module.exports = Response
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| blob.js | File | 2.75 KB | 0644 |
|
| body.js | File | 9.55 KB | 0644 |
|
| common.js | File | 3.07 KB | 0644 |
|
| fetch-error.js | File | 886 B | 0644 |
|
| headers.js | File | 6.41 KB | 0644 |
|
| index.js | File | 6.75 KB | 0644 |
|
| request.js | File | 4.47 KB | 0644 |
|
| response.js | File | 1.4 KB | 0644 |
|