@dkx/http-server
Advanced tools
Comparing version 1.1.0 to 1.2.0
@@ -10,2 +10,4 @@ /// <reference types="node" /> | ||
constructor(method?: string, url?: string, headers?: IncomingHttpHeaders, body?: Readable); | ||
hasHeader(name: string): boolean; | ||
getHeader(name: string): string | Array<string> | undefined; | ||
} |
@@ -10,4 +10,10 @@ "use strict"; | ||
} | ||
hasHeader(name) { | ||
return typeof this.headers[name] !== 'undefined'; | ||
} | ||
getHeader(name) { | ||
return this.headers[name]; | ||
} | ||
} | ||
exports.Request = Request; | ||
//# sourceMappingURL=request.js.map |
{ | ||
"name": "@dkx/http-server", | ||
"version": "1.1.0", | ||
"version": "1.2.0", | ||
"description": "Minimalistic HTTP server", | ||
@@ -5,0 +5,0 @@ "repository": "git@gitlab.com:dkx/http/server.git", |
@@ -167,2 +167,26 @@ # DKX/Http/Server | ||
* **`hasHeader()`** | ||
Test if header exists. | ||
**Arguments:** | ||
`name: string`: Name of header. | ||
**Return:** | ||
`boolean` | ||
* **`getHeader()`** | ||
Return HTTP header. | ||
**Arguments:** | ||
`name: string`: Name of header. | ||
**Return:** | ||
`string|Array<string>|undefined` | ||
## Response object | ||
@@ -169,0 +193,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
33397
404
301