mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-11 20:40:20 +00:00
Account for 'set-cookie' header in Node v8 types
This commit is contained in:
Vendored
+9
-3
@@ -836,14 +836,20 @@ declare module "http" {
|
||||
import * as stream from "stream";
|
||||
import { URL } from "url";
|
||||
|
||||
// incoming headers will never contain number
|
||||
export interface IncomingHttpHeaders {
|
||||
export interface BaseIncomingHttpHeaders {
|
||||
[header: string]: string | string[];
|
||||
}
|
||||
|
||||
export interface SetCookieHttpHeader {
|
||||
'set-cookie'?: string[];
|
||||
}
|
||||
|
||||
// incoming headers will never contain number
|
||||
export type IncomingHttpHeaders = BaseIncomingHttpHeaders & SetCookieHttpHeader;
|
||||
|
||||
// outgoing headers allows numbers (as they are converted internally to strings)
|
||||
export interface OutgoingHttpHeaders {
|
||||
[header: string]: number | string | string[] | undefined;
|
||||
[header: string]: number | string | string[];
|
||||
}
|
||||
|
||||
export interface ClientRequestArgs {
|
||||
|
||||
@@ -1316,9 +1316,24 @@ namespace http_tests {
|
||||
request.abort();
|
||||
}
|
||||
|
||||
const options: http.RequestOptions = {
|
||||
timeout: 30000
|
||||
};
|
||||
// http request options
|
||||
{
|
||||
const requestOpts: http.RequestOptions = {
|
||||
timeout: 30000
|
||||
};
|
||||
|
||||
const clientArgs: http.ClientRequestArgs = {
|
||||
timeout: 30000
|
||||
};
|
||||
}
|
||||
|
||||
// http headers
|
||||
{
|
||||
const headers: http.IncomingHttpHeaders = {
|
||||
'Content-Type': 'application/json',
|
||||
'set-cookie': [ 'type=ninja', 'language=javascript' ]
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////
|
||||
|
||||
Vendored
+11
-9
@@ -557,18 +557,20 @@ declare module "http" {
|
||||
import * as net from "net";
|
||||
import * as stream from "stream";
|
||||
|
||||
// incoming headers will never contain number
|
||||
export type IncomingHttpHeaders = {
|
||||
[header: string]: string
|
||||
} & {
|
||||
'set-cookie'?: string[]
|
||||
export interface BaseIncomingHttpHeaders {
|
||||
[header: string]: string | string[];
|
||||
}
|
||||
|
||||
export interface SetCookieHttpHeader {
|
||||
'set-cookie'?: string[];
|
||||
}
|
||||
|
||||
// incoming headers will never contain number
|
||||
export type IncomingHttpHeaders = BaseIncomingHttpHeaders & SetCookieHttpHeader;
|
||||
|
||||
// outgoing headers allows numbers (as they are converted internally to strings)
|
||||
export type OutgoingHttpHeaders = {
|
||||
[header: string]: number | string
|
||||
} & {
|
||||
'set-cookie'?: string[]
|
||||
export interface OutgoingHttpHeaders {
|
||||
[header: string]: number | string | string[];
|
||||
}
|
||||
|
||||
export interface RequestOptions {
|
||||
|
||||
@@ -500,13 +500,24 @@ namespace http_tests {
|
||||
request.abort();
|
||||
}
|
||||
|
||||
const reqOptions: http.RequestOptions = {
|
||||
timeout: 30000
|
||||
};
|
||||
// http request options
|
||||
{
|
||||
const requestOpts: http.RequestOptions = {
|
||||
timeout: 30000
|
||||
};
|
||||
|
||||
const clientArgs: http.ClientRequestArgs = {
|
||||
timeout: 30000
|
||||
};
|
||||
const clientArgs: http.ClientRequestArgs = {
|
||||
timeout: 30000
|
||||
};
|
||||
}
|
||||
|
||||
// http headers
|
||||
{
|
||||
const headers: http.IncomingHttpHeaders = {
|
||||
'Content-Type': 'application/json',
|
||||
'set-cookie': [ 'type=ninja', 'language=javascript' ]
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////
|
||||
|
||||
Vendored
+11
-9
@@ -629,18 +629,20 @@ declare module "http" {
|
||||
import * as net from "net";
|
||||
import * as stream from "stream";
|
||||
|
||||
// incoming headers will never contain number
|
||||
export type IncomingHttpHeaders = {
|
||||
[header: string]: string
|
||||
} & {
|
||||
'set-cookie'?: string[]
|
||||
export interface BaseIncomingHttpHeaders {
|
||||
[header: string]: string | string[];
|
||||
}
|
||||
|
||||
export interface SetCookieHttpHeader {
|
||||
'set-cookie'?: string[];
|
||||
}
|
||||
|
||||
// incoming headers will never contain number
|
||||
export type IncomingHttpHeaders = BaseIncomingHttpHeaders & SetCookieHttpHeader;
|
||||
|
||||
// outgoing headers allows numbers (as they are converted internally to strings)
|
||||
export type OutgoingHttpHeaders = {
|
||||
[header: string]: number | string
|
||||
} & {
|
||||
'set-cookie'?: string[]
|
||||
export interface OutgoingHttpHeaders {
|
||||
[header: string]: number | string | string[];
|
||||
}
|
||||
|
||||
export interface RequestOptions {
|
||||
|
||||
@@ -936,13 +936,24 @@ namespace http_tests {
|
||||
request.abort();
|
||||
}
|
||||
|
||||
const reqOptions: http.RequestOptions = {
|
||||
timeout: 30000
|
||||
};
|
||||
// http request options
|
||||
{
|
||||
const requestOpts: http.RequestOptions = {
|
||||
timeout: 30000
|
||||
};
|
||||
|
||||
const clientArgs: http.ClientRequestArgs = {
|
||||
timeout: 30000
|
||||
};
|
||||
const clientArgs: http.ClientRequestArgs = {
|
||||
timeout: 30000
|
||||
};
|
||||
}
|
||||
|
||||
// http headers
|
||||
{
|
||||
const headers: http.IncomingHttpHeaders = {
|
||||
'Content-Type': 'application/json',
|
||||
'set-cookie': [ 'type=ninja', 'language=javascript' ]
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////
|
||||
|
||||
Vendored
+11
-9
@@ -646,18 +646,20 @@ declare module "http" {
|
||||
import * as net from "net";
|
||||
import * as stream from "stream";
|
||||
|
||||
// incoming headers will never contain number
|
||||
export type IncomingHttpHeaders = {
|
||||
[header: string]: string
|
||||
} & {
|
||||
'set-cookie'?: string[]
|
||||
export interface BaseIncomingHttpHeaders {
|
||||
[header: string]: string | string[];
|
||||
}
|
||||
|
||||
export interface SetCookieHttpHeader {
|
||||
'set-cookie'?: string[];
|
||||
}
|
||||
|
||||
// incoming headers will never contain number
|
||||
export type IncomingHttpHeaders = BaseIncomingHttpHeaders & SetCookieHttpHeader;
|
||||
|
||||
// outgoing headers allows numbers (as they are converted internally to strings)
|
||||
export type OutgoingHttpHeaders = {
|
||||
[header: string]: number | string
|
||||
} & {
|
||||
'set-cookie'?: string[]
|
||||
export interface OutgoingHttpHeaders {
|
||||
[header: string]: number | string | string[];
|
||||
}
|
||||
|
||||
export interface RequestOptions {
|
||||
|
||||
@@ -1033,13 +1033,24 @@ namespace http_tests {
|
||||
request.abort();
|
||||
}
|
||||
|
||||
const reqOptions: http.RequestOptions = {
|
||||
timeout: 30000
|
||||
};
|
||||
// http request options
|
||||
{
|
||||
const requestOpts: http.RequestOptions = {
|
||||
timeout: 30000
|
||||
};
|
||||
|
||||
const clientArgs: http.ClientRequestArgs = {
|
||||
timeout: 30000
|
||||
};
|
||||
const clientArgs: http.ClientRequestArgs = {
|
||||
timeout: 30000
|
||||
};
|
||||
}
|
||||
|
||||
// http headers
|
||||
{
|
||||
const headers: http.IncomingHttpHeaders = {
|
||||
'Content-Type': 'application/json',
|
||||
'set-cookie': [ 'type=ninja', 'language=javascript' ]
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////
|
||||
|
||||
Reference in New Issue
Block a user