http.RequestOptions.agent can also be a boolean

https://nodejs.org/api/http.html#http_http_request_options_callback
This commit is contained in:
Rogier Schouten
2015-12-17 11:31:43 +01:00
parent 78ba6e4154
commit 1ebf010a1e
2 changed files with 11 additions and 1 deletions

View File

@@ -226,6 +226,16 @@ module http_tests {
});
var agent: http.Agent = http.globalAgent;
http.request({
agent: false
});
http.request({
agent: agent
});
http.request({
agent: undefined
});
}
////////////////////////////////////////////////////

2
node/node.d.ts vendored
View File

@@ -453,7 +453,7 @@ declare module "http" {
path?: string;
headers?: { [key: string]: any };
auth?: string;
agent?: Agent;
agent?: Agent|boolean;
}
export interface Server extends events.EventEmitter {