@adonisjs/http-server 8.0.0-next.5 → 8.0.0-next.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/{chunk-BFGF3A5X.js → chunk-3XEJZ4S4.js} +1105 -566
- package/build/{chunk-ASX56VAK.js → chunk-NQNHMINZ.js} +59 -0
- package/build/factories/http_context.d.ts +2 -1
- package/build/factories/http_server.d.ts +7 -0
- package/build/factories/main.js +31 -5
- package/build/factories/qs_parser_factory.d.ts +3 -2
- package/build/factories/request.d.ts +1 -0
- package/build/factories/response.d.ts +1 -0
- package/build/factories/router.d.ts +1 -0
- package/build/factories/server_factory.d.ts +1 -0
- package/build/factories/url_builder_factory.d.ts +1 -0
- package/build/index.d.ts +3 -1
- package/build/index.js +87 -37
- package/build/src/cookies/client.d.ts +35 -0
- package/build/src/cookies/drivers/encrypted.d.ts +13 -0
- package/build/src/cookies/drivers/plain.d.ts +9 -0
- package/build/src/cookies/drivers/signed.d.ts +13 -0
- package/build/src/cookies/parser.d.ts +18 -0
- package/build/src/cookies/serializer.d.ts +21 -2
- package/build/src/define_config.d.ts +1 -3
- package/build/src/define_middleware.d.ts +1 -1
- package/build/src/exception_handler.d.ts +72 -31
- package/build/src/helpers.d.ts +50 -0
- package/build/src/helpers.js +5 -1
- package/build/src/http_context/local_storage.d.ts +17 -0
- package/build/src/http_context/main.d.ts +8 -0
- package/build/src/qs.d.ts +14 -0
- package/build/src/redirect.d.ts +62 -9
- package/build/src/request.d.ts +109 -10
- package/build/src/response.d.ts +416 -203
- package/build/src/router/brisk.d.ts +13 -0
- package/build/src/router/executor.d.ts +4 -0
- package/build/src/router/factories/use_return_value.d.ts +5 -0
- package/build/src/router/group.d.ts +18 -1
- package/build/src/router/legacy/url_builder.d.ts +14 -14
- package/build/src/router/main.d.ts +73 -4
- package/build/src/router/matchers.d.ts +3 -0
- package/build/src/router/resource.d.ts +34 -1
- package/build/src/router/route.d.ts +9 -1
- package/build/src/router/signed_url_builder.d.ts +4 -8
- package/build/src/router/store.d.ts +9 -0
- package/build/src/router/url_builder.d.ts +4 -9
- package/build/src/server/factories/middleware_handler.d.ts +10 -1
- package/build/src/server/factories/route_finder.d.ts +13 -3
- package/build/src/server/factories/write_response.d.ts +9 -2
- package/build/src/server/main.d.ts +77 -23
- package/build/src/tracing_channels.d.ts +4 -4
- package/build/src/types/middleware.d.ts +34 -9
- package/build/src/types/qs.d.ts +5 -0
- package/build/src/types/request.d.ts +1 -1
- package/build/src/types/response.d.ts +14 -6
- package/build/src/types/route.d.ts +40 -19
- package/build/src/types/server.d.ts +26 -11
- package/build/src/types/tracing_channels.d.ts +21 -3
- package/build/src/types/url_builder.d.ts +24 -11
- package/package.json +17 -15
package/build/src/response.d.ts
CHANGED
|
@@ -7,54 +7,56 @@ import type { Router } from './router/main.ts';
|
|
|
7
7
|
import type { HttpContext } from './http_context/main.ts';
|
|
8
8
|
import type { CastableHeader, CookieOptions, ResponseConfig, ResponseStream } from './types/response.ts';
|
|
9
9
|
/**
|
|
10
|
-
* The
|
|
11
|
-
*
|
|
10
|
+
* The Response class provides a fluent API for constructing HTTP responses.
|
|
11
|
+
*
|
|
12
|
+
* It wraps Node.js ServerResponse and streamlines the process of writing
|
|
13
|
+
* response body, setting headers, handling cookies, redirects, and streaming.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```ts
|
|
17
|
+
* response.status(200).json({ message: 'Hello World' })
|
|
18
|
+
* response.redirect('/dashboard')
|
|
19
|
+
* response.download('/path/to/file.pdf')
|
|
20
|
+
* ```
|
|
12
21
|
*/
|
|
13
22
|
export declare class Response extends Macroable {
|
|
14
23
|
#private;
|
|
15
24
|
request: IncomingMessage;
|
|
16
25
|
response: ServerResponse;
|
|
17
26
|
/**
|
|
18
|
-
*
|
|
19
|
-
* response socket at the end of the request
|
|
27
|
+
* Indicates whether the response has any content (body, stream, or file) ready to be sent
|
|
20
28
|
*/
|
|
21
29
|
get hasLazyBody(): boolean;
|
|
22
30
|
/**
|
|
23
|
-
*
|
|
31
|
+
* Indicates whether the response has non-stream content set
|
|
24
32
|
*/
|
|
25
33
|
get hasContent(): boolean;
|
|
26
34
|
/**
|
|
27
|
-
*
|
|
28
|
-
* method
|
|
35
|
+
* Indicates whether the response body is set as a readable stream
|
|
29
36
|
*/
|
|
30
37
|
get hasStream(): boolean;
|
|
31
38
|
/**
|
|
32
|
-
*
|
|
33
|
-
* or "response.attachment" methods
|
|
39
|
+
* Indicates whether the response is configured to stream a file
|
|
34
40
|
*/
|
|
35
41
|
get hasFileToStream(): boolean;
|
|
36
42
|
/**
|
|
37
|
-
*
|
|
38
|
-
* has content using the "hasContent" method
|
|
43
|
+
* The response content data
|
|
39
44
|
*/
|
|
40
45
|
get content(): [any, boolean, (string | undefined)?] | undefined;
|
|
41
46
|
/**
|
|
42
|
-
*
|
|
43
|
-
* method
|
|
47
|
+
* The readable stream instance configured for the response
|
|
44
48
|
*/
|
|
45
49
|
get outgoingStream(): import("stream").Readable | undefined;
|
|
46
50
|
/**
|
|
47
|
-
*
|
|
48
|
-
* method.
|
|
51
|
+
* Configuration for file streaming including path and etag generation flag
|
|
49
52
|
*/
|
|
50
53
|
get fileToStream(): {
|
|
51
54
|
path: string;
|
|
52
55
|
generateEtag: boolean;
|
|
53
56
|
} | undefined;
|
|
54
57
|
/**
|
|
55
|
-
* Lazy body
|
|
56
|
-
*
|
|
57
|
-
* is called.
|
|
58
|
+
* Lazy body container that holds response content until ready to send.
|
|
59
|
+
* Contains different types of response data: content, stream, or fileToStream.
|
|
58
60
|
*/
|
|
59
61
|
lazyBody: Partial<{
|
|
60
62
|
content: [any, boolean, string?];
|
|
@@ -62,68 +64,106 @@ export declare class Response extends Macroable {
|
|
|
62
64
|
fileToStream: [string, boolean, ((error: NodeJS.ErrnoException) => [string, number?])?];
|
|
63
65
|
}>;
|
|
64
66
|
/**
|
|
65
|
-
*
|
|
66
|
-
* reference
|
|
67
|
+
* HTTP context reference (creates circular dependency with HttpContext)
|
|
67
68
|
*/
|
|
68
69
|
ctx?: HttpContext;
|
|
70
|
+
/**
|
|
71
|
+
* Creates a new Response instance
|
|
72
|
+
*
|
|
73
|
+
* @param request - Node.js IncomingMessage instance
|
|
74
|
+
* @param response - Node.js ServerResponse instance
|
|
75
|
+
* @param encryption - Encryption service for cookie handling
|
|
76
|
+
* @param config - Response configuration settings
|
|
77
|
+
* @param router - Router instance for URL generation
|
|
78
|
+
* @param qs - Query string parser
|
|
79
|
+
*/
|
|
69
80
|
constructor(request: IncomingMessage, response: ServerResponse, encryption: Encryption, config: ResponseConfig, router: Router, qs: Qs);
|
|
70
81
|
/**
|
|
71
|
-
*
|
|
72
|
-
* Any more attempts to update headers or body will result
|
|
73
|
-
* in raised exceptions.
|
|
82
|
+
* Indicates whether the response has been completely sent
|
|
74
83
|
*/
|
|
75
84
|
get finished(): boolean;
|
|
76
85
|
/**
|
|
77
|
-
*
|
|
78
|
-
* Any more attempts to update headers will result in raised
|
|
79
|
-
* exceptions.
|
|
86
|
+
* Indicates whether response headers have been sent to the client
|
|
80
87
|
*/
|
|
81
88
|
get headersSent(): boolean;
|
|
82
89
|
/**
|
|
83
|
-
*
|
|
84
|
-
* or not. When value is `true`, you can feel free to write headers
|
|
85
|
-
* and body.
|
|
90
|
+
* Indicates whether the response is still pending (headers and body can still be modified)
|
|
86
91
|
*/
|
|
87
92
|
get isPending(): boolean;
|
|
88
93
|
/**
|
|
89
|
-
* Writes the body with appropriate
|
|
90
|
-
* when `generateEtag` is set to `true`.
|
|
94
|
+
* Writes the response body with appropriate headers and content type detection
|
|
91
95
|
*
|
|
92
|
-
*
|
|
96
|
+
* Automatically sets:
|
|
97
|
+
* - Content-Type based on content analysis
|
|
98
|
+
* - Content-Length header
|
|
99
|
+
* - ETag header (if enabled)
|
|
100
|
+
* - Status code 204 for empty bodies
|
|
101
|
+
*
|
|
102
|
+
* @param content - The response content
|
|
103
|
+
* @param generateEtag - Whether to generate ETag header
|
|
104
|
+
* @param jsonpCallbackName - Optional JSONP callback name
|
|
93
105
|
*/
|
|
94
106
|
protected writeBody(content: any, generateEtag: boolean, jsonpCallbackName?: string): void;
|
|
95
107
|
/**
|
|
96
|
-
*
|
|
108
|
+
* Streams the response body and handles error cleanup
|
|
109
|
+
*
|
|
110
|
+
* Manages stream lifecycle including:
|
|
111
|
+
* - Error handling with custom callbacks
|
|
112
|
+
* - Proper stream cleanup to prevent memory leaks
|
|
113
|
+
* - Response finalization
|
|
114
|
+
*
|
|
115
|
+
* @param body - The readable stream to pipe
|
|
116
|
+
* @param errorCallback - Optional custom error handler
|
|
117
|
+
* @returns Promise that resolves when streaming is complete
|
|
97
118
|
*/
|
|
98
119
|
protected streamBody(body: ResponseStream, errorCallback?: (error: NodeJS.ErrnoException) => [string, number?]): Promise<void>;
|
|
99
120
|
/**
|
|
100
|
-
*
|
|
121
|
+
* Streams a file for download with proper headers and caching support
|
|
122
|
+
*
|
|
123
|
+
* Sets appropriate headers:
|
|
124
|
+
* - Last-Modified based on file stats
|
|
125
|
+
* - Content-Type based on file extension
|
|
126
|
+
* - Content-Length from file size
|
|
127
|
+
* - ETag (if enabled)
|
|
128
|
+
*
|
|
129
|
+
* Handles HEAD requests and cache validation (304 responses).
|
|
130
|
+
*
|
|
131
|
+
* @param filePath - Path to the file to stream
|
|
132
|
+
* @param generateEtag - Whether to generate ETag header
|
|
133
|
+
* @param errorCallback - Optional custom error handler
|
|
101
134
|
*/
|
|
102
135
|
protected streamFileForDownload(filePath: string, generateEtag: boolean, errorCallback?: (error: NodeJS.ErrnoException) => [string, number?]): Promise<void>;
|
|
103
136
|
/**
|
|
104
|
-
*
|
|
105
|
-
* to the TCP socket.
|
|
137
|
+
* Registers a callback to be called when the response is finished
|
|
106
138
|
*
|
|
107
|
-
*
|
|
108
|
-
* the "
|
|
139
|
+
* The callback is executed when the response has been completely sent.
|
|
140
|
+
* Uses the "on-finished" package internally.
|
|
141
|
+
*
|
|
142
|
+
* @param callback - Function to call when response is finished
|
|
109
143
|
*/
|
|
110
144
|
onFinish(callback: (err: Error | null, response: ServerResponse) => void): void;
|
|
111
145
|
/**
|
|
112
|
-
*
|
|
113
|
-
* response.setHeader method
|
|
146
|
+
* Transfers all buffered headers to the underlying Node.js response object
|
|
114
147
|
*/
|
|
115
148
|
relayHeaders(): void;
|
|
116
149
|
/**
|
|
117
|
-
*
|
|
150
|
+
* Writes the response status code and headers
|
|
151
|
+
*
|
|
152
|
+
* @param statusCode - Optional status code to set
|
|
153
|
+
* @returns The Response instance for chaining
|
|
118
154
|
*/
|
|
119
155
|
writeHead(statusCode?: number): this;
|
|
120
156
|
/**
|
|
121
|
-
*
|
|
122
|
-
*
|
|
157
|
+
* Gets the value of a response header
|
|
158
|
+
*
|
|
159
|
+
* @param key - Header name
|
|
160
|
+
* @returns The header value
|
|
123
161
|
*/
|
|
124
162
|
getHeader(key: string): import("http").OutgoingHttpHeader | undefined;
|
|
125
163
|
/**
|
|
126
|
-
*
|
|
164
|
+
* Gets all response headers as an object
|
|
165
|
+
*
|
|
166
|
+
* @returns Object containing all headers
|
|
127
167
|
*/
|
|
128
168
|
getHeaders(): {
|
|
129
169
|
[x: string]: import("http").OutgoingHttpHeader | undefined;
|
|
@@ -209,423 +249,596 @@ export declare class Response extends Macroable {
|
|
|
209
249
|
"x-xss-protection"?: string | undefined;
|
|
210
250
|
};
|
|
211
251
|
/**
|
|
212
|
-
*
|
|
213
|
-
* using [[append]] method.
|
|
252
|
+
* Sets a response header (replaces existing value)
|
|
214
253
|
*
|
|
215
|
-
*
|
|
254
|
+
* @param key - Header name
|
|
255
|
+
* @param value - Header value (ignored if null/undefined)
|
|
256
|
+
* @returns The Response instance for chaining
|
|
216
257
|
*
|
|
217
258
|
* @example
|
|
218
|
-
* ```
|
|
219
|
-
* response.header('
|
|
259
|
+
* ```ts
|
|
260
|
+
* response.header('Content-Type', 'application/json')
|
|
220
261
|
* ```
|
|
221
262
|
*/
|
|
222
263
|
header(key: string, value: CastableHeader): this;
|
|
223
264
|
/**
|
|
224
|
-
*
|
|
225
|
-
* [[header]] method.
|
|
265
|
+
* Appends a value to an existing response header
|
|
226
266
|
*
|
|
227
|
-
*
|
|
267
|
+
* @param key - Header name
|
|
268
|
+
* @param value - Header value to append (ignored if null/undefined)
|
|
269
|
+
* @returns The Response instance for chaining
|
|
228
270
|
*
|
|
229
271
|
* @example
|
|
230
|
-
* ```
|
|
231
|
-
* response.append('
|
|
272
|
+
* ```ts
|
|
273
|
+
* response.append('Set-Cookie', 'session=abc123')
|
|
232
274
|
* ```
|
|
233
275
|
*/
|
|
234
276
|
append(key: string, value: CastableHeader): this;
|
|
235
277
|
/**
|
|
236
|
-
*
|
|
278
|
+
* Sets a header only if it doesn't already exist
|
|
279
|
+
*
|
|
280
|
+
* @param key - Header name
|
|
281
|
+
* @param value - Header value
|
|
282
|
+
* @returns The Response instance for chaining
|
|
237
283
|
*/
|
|
238
284
|
safeHeader(key: string, value: CastableHeader): this;
|
|
239
285
|
/**
|
|
240
|
-
* Removes
|
|
286
|
+
* Removes a response header
|
|
287
|
+
*
|
|
288
|
+
* @param key - Header name to remove
|
|
289
|
+
* @returns The Response instance for chaining
|
|
241
290
|
*/
|
|
242
291
|
removeHeader(key: string): this;
|
|
243
292
|
/**
|
|
244
|
-
*
|
|
293
|
+
* Gets the current response status code
|
|
294
|
+
*
|
|
295
|
+
* @returns The HTTP status code
|
|
245
296
|
*/
|
|
246
297
|
getStatus(): number;
|
|
247
298
|
/**
|
|
248
|
-
*
|
|
299
|
+
* Sets the response status code
|
|
300
|
+
*
|
|
301
|
+
* @param code - HTTP status code
|
|
302
|
+
* @returns The Response instance for chaining
|
|
249
303
|
*/
|
|
250
304
|
status(code: number): this;
|
|
251
305
|
/**
|
|
252
|
-
*
|
|
253
|
-
*
|
|
306
|
+
* Sets the status code only if not explicitly set already
|
|
307
|
+
*
|
|
308
|
+
* @param code - HTTP status code
|
|
309
|
+
* @returns The Response instance for chaining
|
|
254
310
|
*/
|
|
255
311
|
safeStatus(code: number): this;
|
|
256
312
|
/**
|
|
257
|
-
*
|
|
258
|
-
* partial types like file extensions.
|
|
313
|
+
* Sets the Content-Type header based on mime type lookup
|
|
259
314
|
*
|
|
260
|
-
*
|
|
261
|
-
*
|
|
315
|
+
* @param type - File extension or mime type
|
|
316
|
+
* @param charset - Optional character encoding
|
|
317
|
+
* @returns The Response instance for chaining
|
|
262
318
|
*
|
|
263
319
|
* @example
|
|
264
|
-
* ```
|
|
265
|
-
* response.type('.json') // Content-
|
|
320
|
+
* ```ts
|
|
321
|
+
* response.type('.json') // Content-Type: application/json
|
|
322
|
+
* response.type('html', 'utf-8') // Content-Type: text/html; charset=utf-8
|
|
266
323
|
* ```
|
|
267
324
|
*/
|
|
268
325
|
type(type: string, charset?: string): this;
|
|
269
326
|
/**
|
|
270
|
-
*
|
|
327
|
+
* Sets the Vary HTTP header for cache control
|
|
328
|
+
*
|
|
329
|
+
* @param field - Header field name(s) to vary on
|
|
330
|
+
* @returns The Response instance for chaining
|
|
271
331
|
*/
|
|
272
332
|
vary(field: string | string[]): this;
|
|
273
333
|
/**
|
|
274
|
-
*
|
|
275
|
-
* when `etag = true` in the defined config object.
|
|
334
|
+
* Sets the ETag header by computing a hash from the response body
|
|
276
335
|
*
|
|
277
|
-
*
|
|
336
|
+
* @param body - The response body to hash
|
|
337
|
+
* @param weak - Whether to generate a weak ETag
|
|
338
|
+
* @returns The Response instance for chaining
|
|
278
339
|
*/
|
|
279
340
|
setEtag(body: any, weak?: boolean): this;
|
|
280
341
|
/**
|
|
281
|
-
*
|
|
342
|
+
* Sets the X-Request-Id header by copying from the incoming request
|
|
282
343
|
*
|
|
344
|
+
* @returns The Response instance for chaining
|
|
283
345
|
*/
|
|
284
346
|
setRequestId(): this;
|
|
285
347
|
/**
|
|
286
|
-
*
|
|
287
|
-
* as the request header `if-none-match`. In case of `true`, the
|
|
288
|
-
* server must return `304` response, telling the browser to
|
|
289
|
-
* use the client cache.
|
|
348
|
+
* Checks if the response is fresh (client cache is valid)
|
|
290
349
|
*
|
|
291
|
-
*
|
|
292
|
-
*
|
|
350
|
+
* Compares ETags and modified dates between request and response
|
|
351
|
+
* to determine if a 304 Not Modified response should be sent.
|
|
293
352
|
*
|
|
294
|
-
*
|
|
353
|
+
* @returns True if client cache is fresh, false otherwise
|
|
295
354
|
*
|
|
296
355
|
* @example
|
|
297
|
-
* ```
|
|
298
|
-
*
|
|
299
|
-
*
|
|
300
|
-
* // sets the HTTP etag header for response
|
|
301
|
-
* response.setEtag(responseBody)
|
|
302
|
-
*
|
|
356
|
+
* ```ts
|
|
357
|
+
* response.setEtag(content)
|
|
303
358
|
* if (response.fresh()) {
|
|
304
|
-
* response.
|
|
359
|
+
* response.status(304).send(null)
|
|
305
360
|
* } else {
|
|
306
|
-
* response.send(
|
|
361
|
+
* response.send(content)
|
|
307
362
|
* }
|
|
308
363
|
* ```
|
|
309
364
|
*/
|
|
310
365
|
fresh(): boolean;
|
|
311
366
|
/**
|
|
312
|
-
*
|
|
313
|
-
*
|
|
367
|
+
* Gets the response body content
|
|
368
|
+
*
|
|
369
|
+
* @returns The response body or null if not set or is a stream
|
|
314
370
|
*/
|
|
315
371
|
getBody(): any;
|
|
316
372
|
/**
|
|
317
|
-
*
|
|
318
|
-
* is read from `config/app.js` file, using `http.etag` property.
|
|
373
|
+
* Sends the response body with optional ETag generation
|
|
319
374
|
*
|
|
320
|
-
*
|
|
321
|
-
*
|
|
375
|
+
* @param body - The response body
|
|
376
|
+
* @param generateEtag - Whether to generate ETag header (defaults to config)
|
|
322
377
|
*/
|
|
323
378
|
send(body: any, generateEtag?: boolean): void;
|
|
324
379
|
/**
|
|
325
|
-
*
|
|
380
|
+
* Sends a JSON response (alias for send)
|
|
381
|
+
*
|
|
382
|
+
* @param body - The response body to serialize as JSON
|
|
383
|
+
* @param generateEtag - Whether to generate ETag header
|
|
326
384
|
*/
|
|
327
385
|
json(body: any, generateEtag?: boolean): void;
|
|
328
386
|
/**
|
|
329
|
-
*
|
|
330
|
-
* from top to bottom.
|
|
387
|
+
* Sends a JSONP response with callback wrapping
|
|
331
388
|
*
|
|
332
|
-
*
|
|
333
|
-
*
|
|
334
|
-
*
|
|
335
|
-
*
|
|
389
|
+
* Callback name resolution priority:
|
|
390
|
+
* 1. Explicit callbackName parameter
|
|
391
|
+
* 2. Query string parameter
|
|
392
|
+
* 3. Config value
|
|
393
|
+
* 4. Default "callback"
|
|
336
394
|
*
|
|
337
|
-
*
|
|
338
|
-
*
|
|
395
|
+
* @param body - The response body
|
|
396
|
+
* @param callbackName - JSONP callback function name
|
|
397
|
+
* @param generateEtag - Whether to generate ETag header
|
|
339
398
|
*/
|
|
340
399
|
jsonp(body: any, callbackName?: string, generateEtag?: boolean): void;
|
|
341
400
|
/**
|
|
342
|
-
*
|
|
343
|
-
* the stream, avoiding memory leaks.
|
|
344
|
-
*
|
|
345
|
-
* If `raiseErrors=false`, then this method will self handle all the exceptions by
|
|
346
|
-
* writing a generic HTTP response. To have more control over the error, it is
|
|
347
|
-
* recommended to set `raiseErrors=true` and wrap this function inside a
|
|
348
|
-
* `try/catch` statement.
|
|
401
|
+
* Pipes a readable stream to the response with graceful error handling
|
|
349
402
|
*
|
|
350
|
-
*
|
|
403
|
+
* @param body - The readable stream to pipe
|
|
404
|
+
* @param errorCallback - Optional custom error handler
|
|
351
405
|
*
|
|
352
406
|
* @example
|
|
353
|
-
* ```
|
|
354
|
-
* //
|
|
407
|
+
* ```ts
|
|
408
|
+
* // Auto error handling
|
|
355
409
|
* response.stream(fs.createReadStream('file.txt'))
|
|
356
410
|
*
|
|
357
|
-
* //
|
|
358
|
-
*
|
|
359
|
-
*
|
|
360
|
-
* }
|
|
361
|
-
* response.status(404).send('File not found')
|
|
362
|
-
* }
|
|
411
|
+
* // Custom error handling
|
|
412
|
+
* response.stream(stream, (error) => {
|
|
413
|
+
* return error.code === 'ENOENT' ? ['Not found', 404] : ['Error', 500]
|
|
414
|
+
* })
|
|
363
415
|
* ```
|
|
364
416
|
*/
|
|
365
417
|
stream(body: ResponseStream, errorCallback?: (error: NodeJS.ErrnoException) => [string, number?]): void;
|
|
366
418
|
/**
|
|
367
|
-
*
|
|
368
|
-
* appropriate `Content-type`, `Content-type` and `Last-modified` headers.
|
|
419
|
+
* Downloads a file by streaming it with appropriate headers
|
|
369
420
|
*
|
|
370
|
-
*
|
|
421
|
+
* Automatically sets:
|
|
422
|
+
* - Content-Type from file extension
|
|
423
|
+
* - Content-Length from file size
|
|
424
|
+
* - Last-Modified from file stats
|
|
425
|
+
* - ETag (if enabled)
|
|
371
426
|
*
|
|
372
|
-
*
|
|
373
|
-
*
|
|
374
|
-
*
|
|
375
|
-
* `try/catch` statement.
|
|
427
|
+
* @param filePath - Path to the file to download
|
|
428
|
+
* @param generateEtag - Whether to generate ETag header
|
|
429
|
+
* @param errorCallback - Optional custom error handler
|
|
376
430
|
*
|
|
377
431
|
* @example
|
|
378
|
-
* ```
|
|
379
|
-
*
|
|
380
|
-
* response.download('
|
|
381
|
-
*
|
|
382
|
-
* // Manually handle (note the await call)
|
|
383
|
-
* try {
|
|
384
|
-
* await response.download('somefile.jpg')
|
|
385
|
-
* } catch (error) {
|
|
386
|
-
* response.status(error.code === 'ENOENT' ? 404 : 500)
|
|
387
|
-
* response.send('Cannot process file')
|
|
388
|
-
* }
|
|
432
|
+
* ```ts
|
|
433
|
+
* response.download('/path/to/file.pdf')
|
|
434
|
+
* response.download('/images/photo.jpg', true, (err) => ['Custom error', 500])
|
|
389
435
|
* ```
|
|
390
436
|
*/
|
|
391
437
|
download(filePath: string, generateEtag?: boolean, errorCallback?: (error: NodeJS.ErrnoException) => [string, number?]): void;
|
|
392
438
|
/**
|
|
393
|
-
*
|
|
394
|
-
* within the browser.
|
|
439
|
+
* Forces file download by setting Content-Disposition header
|
|
395
440
|
*
|
|
396
|
-
*
|
|
441
|
+
* @param filePath - Path to the file to download
|
|
442
|
+
* @param name - Optional filename for download (defaults to original filename)
|
|
443
|
+
* @param disposition - Content-Disposition type (defaults to 'attachment')
|
|
444
|
+
* @param generateEtag - Whether to generate ETag header
|
|
445
|
+
* @param errorCallback - Optional custom error handler
|
|
397
446
|
*/
|
|
398
447
|
attachment(filePath: string, name?: string, disposition?: string, generateEtag?: boolean, errorCallback?: (error: NodeJS.ErrnoException) => [string, number?]): void;
|
|
399
448
|
/**
|
|
400
|
-
*
|
|
449
|
+
* Sets the Location header for redirects
|
|
450
|
+
*
|
|
451
|
+
* @param url - The URL to redirect to
|
|
452
|
+
* @returns The Response instance for chaining
|
|
401
453
|
*
|
|
402
454
|
* @example
|
|
403
|
-
* ```
|
|
404
|
-
* response.location('/
|
|
455
|
+
* ```ts
|
|
456
|
+
* response.location('/dashboard')
|
|
405
457
|
* ```
|
|
406
458
|
*/
|
|
407
459
|
location(url: string): this;
|
|
408
460
|
/**
|
|
409
|
-
* Redirect
|
|
461
|
+
* Returns a Redirect instance for fluent API usage
|
|
462
|
+
*
|
|
463
|
+
* Use this overload when you want to use methods like `.toRoute()`, `.back()`,
|
|
464
|
+
* `.withQs()`, or other redirect builder methods.
|
|
465
|
+
*
|
|
466
|
+
* @returns Redirect instance for chaining redirect methods
|
|
410
467
|
*
|
|
411
468
|
* @example
|
|
412
|
-
* ```
|
|
413
|
-
* response.redirect('
|
|
414
|
-
* response.redirect().toRoute('foo.bar')
|
|
469
|
+
* ```ts
|
|
470
|
+
* response.redirect().toRoute('users.show', { id: 1 })
|
|
415
471
|
* response.redirect().back()
|
|
472
|
+
* response.redirect().withQs().toPath('/dashboard')
|
|
416
473
|
* ```
|
|
417
474
|
*/
|
|
418
475
|
redirect(): Redirect;
|
|
476
|
+
/**
|
|
477
|
+
* Performs an immediate redirect to the specified path
|
|
478
|
+
*
|
|
479
|
+
* This overload directly redirects the request with the provided parameters.
|
|
480
|
+
* Use this when you have a simple redirect without needing the fluent API.
|
|
481
|
+
*
|
|
482
|
+
* @param path - The path or URL to redirect to (use 'back' for referrer redirect)
|
|
483
|
+
* @param forwardQueryString - Whether to forward current query string parameters
|
|
484
|
+
* @param statusCode - HTTP status code for redirect (defaults to 302 Found)
|
|
485
|
+
*
|
|
486
|
+
* @example
|
|
487
|
+
* ```ts
|
|
488
|
+
* response.redirect('/dashboard')
|
|
489
|
+
* response.redirect('/users', true, 301) // with query forwarding and 301 status
|
|
490
|
+
* response.redirect('back') // redirect to referrer
|
|
491
|
+
* ```
|
|
492
|
+
*/
|
|
419
493
|
redirect(path: string, forwardQueryString?: boolean, statusCode?: number): void;
|
|
420
494
|
/**
|
|
421
|
-
*
|
|
422
|
-
*
|
|
495
|
+
* Aborts the request with a custom response body and status code
|
|
496
|
+
*
|
|
497
|
+
* @param body - Response body for the aborted request
|
|
498
|
+
* @param status - HTTP status code (defaults to 400)
|
|
499
|
+
* @throws Always throws an HTTP exception
|
|
423
500
|
*/
|
|
424
501
|
abort(body: any, status?: number): never;
|
|
425
502
|
/**
|
|
426
|
-
*
|
|
427
|
-
*
|
|
503
|
+
* Conditionally aborts the request if the condition is truthy
|
|
504
|
+
*
|
|
505
|
+
* @param condition - Condition to evaluate
|
|
506
|
+
* @param body - Response body for the aborted request
|
|
507
|
+
* @param status - HTTP status code (defaults to 400)
|
|
428
508
|
*/
|
|
429
509
|
abortIf(condition: unknown, body: any, status?: number): asserts condition is undefined | null | false;
|
|
430
510
|
/**
|
|
431
|
-
*
|
|
432
|
-
*
|
|
511
|
+
* Conditionally aborts the request if the condition is falsy
|
|
512
|
+
*
|
|
513
|
+
* @param condition - Condition to evaluate
|
|
514
|
+
* @param body - Response body for the aborted request
|
|
515
|
+
* @param status - HTTP status code (defaults to 400)
|
|
433
516
|
*/
|
|
434
517
|
abortUnless<T>(condition: T, body: any, status?: number): asserts condition is Exclude<T, undefined | null | false>;
|
|
435
518
|
/**
|
|
436
|
-
*
|
|
437
|
-
*
|
|
519
|
+
* Sets a signed cookie in the response
|
|
520
|
+
*
|
|
521
|
+
* @param key - Cookie name
|
|
522
|
+
* @param value - Cookie value
|
|
523
|
+
* @param options - Cookie options (overrides config defaults)
|
|
524
|
+
* @returns The Response instance for chaining
|
|
438
525
|
*/
|
|
439
526
|
cookie(key: string, value: any, options?: Partial<CookieOptions>): this;
|
|
440
527
|
/**
|
|
441
|
-
*
|
|
442
|
-
*
|
|
528
|
+
* Sets an encrypted cookie in the response
|
|
529
|
+
*
|
|
530
|
+
* @param key - Cookie name
|
|
531
|
+
* @param value - Cookie value
|
|
532
|
+
* @param options - Cookie options (overrides config defaults)
|
|
533
|
+
* @returns The Response instance for chaining
|
|
443
534
|
*/
|
|
444
535
|
encryptedCookie(key: string, value: any, options?: Partial<CookieOptions>): this;
|
|
445
536
|
/**
|
|
446
|
-
*
|
|
447
|
-
*
|
|
537
|
+
* Sets a plain (unsigned/unencrypted) cookie in the response
|
|
538
|
+
*
|
|
539
|
+
* @param key - Cookie name
|
|
540
|
+
* @param value - Cookie value
|
|
541
|
+
* @param options - Cookie options including encode flag
|
|
542
|
+
* @returns The Response instance for chaining
|
|
448
543
|
*/
|
|
449
544
|
plainCookie(key: string, value: any, options?: Partial<CookieOptions & {
|
|
450
545
|
encode: boolean;
|
|
451
546
|
}>): this;
|
|
452
547
|
/**
|
|
453
|
-
*
|
|
548
|
+
* Clears an existing cookie by setting it to expire
|
|
549
|
+
*
|
|
550
|
+
* @param key - Cookie name to clear
|
|
551
|
+
* @param options - Cookie options (should match original cookie options)
|
|
552
|
+
* @returns The Response instance for chaining
|
|
454
553
|
*/
|
|
455
554
|
clearCookie(key: string, options?: Partial<CookieOptions>): this;
|
|
456
555
|
/**
|
|
457
|
-
*
|
|
458
|
-
* and response is already pending.
|
|
556
|
+
* Finalizes and sends the response
|
|
459
557
|
*
|
|
460
|
-
*
|
|
558
|
+
* Writes the buffered body (content, stream, or file) to the client.
|
|
559
|
+
* This method is idempotent - calling it multiple times has no effect.
|
|
461
560
|
*/
|
|
462
561
|
finish(): void;
|
|
463
562
|
/**
|
|
464
|
-
*
|
|
563
|
+
* Sends a 100 Continue response
|
|
465
564
|
*/
|
|
466
565
|
continue(): void;
|
|
467
566
|
/**
|
|
468
|
-
*
|
|
567
|
+
* Sends a 101 Switching Protocols response
|
|
469
568
|
*/
|
|
470
569
|
switchingProtocols(): void;
|
|
471
570
|
/**
|
|
472
|
-
*
|
|
571
|
+
* Sends a 200 OK response
|
|
572
|
+
*
|
|
573
|
+
* @param body - Response body
|
|
574
|
+
* @param generateEtag - Whether to generate ETag header
|
|
473
575
|
*/
|
|
474
576
|
ok(body: any, generateEtag?: boolean): void;
|
|
475
577
|
/**
|
|
476
|
-
*
|
|
578
|
+
* Sends a 201 Created response
|
|
579
|
+
*
|
|
580
|
+
* @param body - Response body
|
|
581
|
+
* @param generateEtag - Whether to generate ETag header
|
|
477
582
|
*/
|
|
478
583
|
created(body?: any, generateEtag?: boolean): void;
|
|
479
584
|
/**
|
|
480
|
-
*
|
|
585
|
+
* Sends a 202 Accepted response
|
|
586
|
+
*
|
|
587
|
+
* @param body - Response body
|
|
588
|
+
* @param generateEtag - Whether to generate ETag header
|
|
481
589
|
*/
|
|
482
590
|
accepted(body: any, generateEtag?: boolean): void;
|
|
483
591
|
/**
|
|
484
|
-
*
|
|
592
|
+
* Sends a 203 Non-Authoritative Information response
|
|
593
|
+
*
|
|
594
|
+
* @param body - Response body
|
|
595
|
+
* @param generateEtag - Whether to generate ETag header
|
|
485
596
|
*/
|
|
486
597
|
nonAuthoritativeInformation(body: any, generateEtag?: boolean): void;
|
|
487
598
|
/**
|
|
488
|
-
*
|
|
599
|
+
* Sends a 204 No Content response
|
|
489
600
|
*/
|
|
490
601
|
noContent(): void;
|
|
491
602
|
/**
|
|
492
|
-
*
|
|
603
|
+
* Sends a 205 Reset Content response
|
|
493
604
|
*/
|
|
494
605
|
resetContent(): void;
|
|
495
606
|
/**
|
|
496
|
-
*
|
|
607
|
+
* Sends a 206 Partial Content response
|
|
608
|
+
*
|
|
609
|
+
* @param body - Response body
|
|
610
|
+
* @param generateEtag - Whether to generate ETag header
|
|
497
611
|
*/
|
|
498
612
|
partialContent(body: any, generateEtag?: boolean): void;
|
|
499
613
|
/**
|
|
500
|
-
*
|
|
614
|
+
* Sends a 300 Multiple Choices response
|
|
615
|
+
*
|
|
616
|
+
* @param body - Response body
|
|
617
|
+
* @param generateEtag - Whether to generate ETag header
|
|
501
618
|
*/
|
|
502
619
|
multipleChoices(body?: any, generateEtag?: boolean): void;
|
|
503
620
|
/**
|
|
504
|
-
*
|
|
621
|
+
* Sends a 301 Moved Permanently response
|
|
622
|
+
*
|
|
623
|
+
* @param body - Response body
|
|
624
|
+
* @param generateEtag - Whether to generate ETag header
|
|
505
625
|
*/
|
|
506
626
|
movedPermanently(body?: any, generateEtag?: boolean): void;
|
|
507
627
|
/**
|
|
508
|
-
*
|
|
628
|
+
* Sends a 302 Found (Moved Temporarily) response
|
|
629
|
+
*
|
|
630
|
+
* @param body - Response body
|
|
631
|
+
* @param generateEtag - Whether to generate ETag header
|
|
509
632
|
*/
|
|
510
633
|
movedTemporarily(body?: any, generateEtag?: boolean): void;
|
|
511
634
|
/**
|
|
512
|
-
*
|
|
635
|
+
* Sends a 303 See Other response
|
|
636
|
+
*
|
|
637
|
+
* @param body - Response body
|
|
638
|
+
* @param generateEtag - Whether to generate ETag header
|
|
513
639
|
*/
|
|
514
640
|
seeOther(body?: any, generateEtag?: boolean): void;
|
|
515
641
|
/**
|
|
516
|
-
*
|
|
642
|
+
* Sends a 304 Not Modified response
|
|
643
|
+
*
|
|
644
|
+
* @param body - Response body
|
|
645
|
+
* @param generateEtag - Whether to generate ETag header
|
|
517
646
|
*/
|
|
518
647
|
notModified(body?: any, generateEtag?: boolean): void;
|
|
519
648
|
/**
|
|
520
|
-
*
|
|
649
|
+
* Sends a 305 Use Proxy response
|
|
650
|
+
*
|
|
651
|
+
* @param body - Response body
|
|
652
|
+
* @param generateEtag - Whether to generate ETag header
|
|
521
653
|
*/
|
|
522
654
|
useProxy(body?: any, generateEtag?: boolean): void;
|
|
523
655
|
/**
|
|
524
|
-
*
|
|
656
|
+
* Sends a 307 Temporary Redirect response
|
|
657
|
+
*
|
|
658
|
+
* @param body - Response body
|
|
659
|
+
* @param generateEtag - Whether to generate ETag header
|
|
525
660
|
*/
|
|
526
661
|
temporaryRedirect(body?: any, generateEtag?: boolean): void;
|
|
527
662
|
/**
|
|
528
|
-
*
|
|
663
|
+
* Sends a 400 Bad Request response
|
|
664
|
+
*
|
|
665
|
+
* @param body - Response body
|
|
666
|
+
* @param generateEtag - Whether to generate ETag header
|
|
529
667
|
*/
|
|
530
668
|
badRequest(body?: any, generateEtag?: boolean): void;
|
|
531
669
|
/**
|
|
532
|
-
*
|
|
670
|
+
* Sends a 401 Unauthorized response
|
|
671
|
+
*
|
|
672
|
+
* @param body - Response body
|
|
673
|
+
* @param generateEtag - Whether to generate ETag header
|
|
533
674
|
*/
|
|
534
675
|
unauthorized(body?: any, generateEtag?: boolean): void;
|
|
535
676
|
/**
|
|
536
|
-
*
|
|
677
|
+
* Sends a 402 Payment Required response
|
|
678
|
+
*
|
|
679
|
+
* @param body - Response body
|
|
680
|
+
* @param generateEtag - Whether to generate ETag header
|
|
537
681
|
*/
|
|
538
682
|
paymentRequired(body?: any, generateEtag?: boolean): void;
|
|
539
683
|
/**
|
|
540
|
-
*
|
|
684
|
+
* Sends a 403 Forbidden response
|
|
685
|
+
*
|
|
686
|
+
* @param body - Response body
|
|
687
|
+
* @param generateEtag - Whether to generate ETag header
|
|
541
688
|
*/
|
|
542
689
|
forbidden(body?: any, generateEtag?: boolean): void;
|
|
543
690
|
/**
|
|
544
|
-
*
|
|
691
|
+
* Sends a 404 Not Found response
|
|
692
|
+
*
|
|
693
|
+
* @param body - Response body
|
|
694
|
+
* @param generateEtag - Whether to generate ETag header
|
|
545
695
|
*/
|
|
546
696
|
notFound(body?: any, generateEtag?: boolean): void;
|
|
547
697
|
/**
|
|
548
|
-
*
|
|
698
|
+
* Sends a 405 Method Not Allowed response
|
|
699
|
+
*
|
|
700
|
+
* @param body - Response body
|
|
701
|
+
* @param generateEtag - Whether to generate ETag header
|
|
549
702
|
*/
|
|
550
703
|
methodNotAllowed(body?: any, generateEtag?: boolean): void;
|
|
551
704
|
/**
|
|
552
|
-
*
|
|
705
|
+
* Sends a 406 Not Acceptable response
|
|
706
|
+
*
|
|
707
|
+
* @param body - Response body
|
|
708
|
+
* @param generateEtag - Whether to generate ETag header
|
|
553
709
|
*/
|
|
554
710
|
notAcceptable(body?: any, generateEtag?: boolean): void;
|
|
555
711
|
/**
|
|
556
|
-
*
|
|
712
|
+
* Sends a 407 Proxy Authentication Required response
|
|
713
|
+
*
|
|
714
|
+
* @param body - Response body
|
|
715
|
+
* @param generateEtag - Whether to generate ETag header
|
|
557
716
|
*/
|
|
558
717
|
proxyAuthenticationRequired(body?: any, generateEtag?: boolean): void;
|
|
559
718
|
/**
|
|
560
|
-
*
|
|
719
|
+
* Sends a 408 Request Timeout response
|
|
720
|
+
*
|
|
721
|
+
* @param body - Response body
|
|
722
|
+
* @param generateEtag - Whether to generate ETag header
|
|
561
723
|
*/
|
|
562
724
|
requestTimeout(body?: any, generateEtag?: boolean): void;
|
|
563
725
|
/**
|
|
564
|
-
*
|
|
726
|
+
* Sends a 409 Conflict response
|
|
727
|
+
*
|
|
728
|
+
* @param body - Response body
|
|
729
|
+
* @param generateEtag - Whether to generate ETag header
|
|
565
730
|
*/
|
|
566
731
|
conflict(body?: any, generateEtag?: boolean): void;
|
|
567
732
|
/**
|
|
568
|
-
*
|
|
733
|
+
* Sends a 410 Gone response
|
|
734
|
+
*
|
|
735
|
+
* @param body - Response body
|
|
736
|
+
* @param generateEtag - Whether to generate ETag header
|
|
569
737
|
*/
|
|
570
738
|
gone(body?: any, generateEtag?: boolean): void;
|
|
571
739
|
/**
|
|
572
|
-
*
|
|
740
|
+
* Sends a 411 Length Required response
|
|
741
|
+
*
|
|
742
|
+
* @param body - Response body
|
|
743
|
+
* @param generateEtag - Whether to generate ETag header
|
|
573
744
|
*/
|
|
574
745
|
lengthRequired(body?: any, generateEtag?: boolean): void;
|
|
575
746
|
/**
|
|
576
|
-
*
|
|
747
|
+
* Sends a 412 Precondition Failed response
|
|
748
|
+
*
|
|
749
|
+
* @param body - Response body
|
|
750
|
+
* @param generateEtag - Whether to generate ETag header
|
|
577
751
|
*/
|
|
578
752
|
preconditionFailed(body?: any, generateEtag?: boolean): void;
|
|
579
753
|
/**
|
|
580
|
-
*
|
|
754
|
+
* Sends a 413 Payload Too Large response
|
|
755
|
+
*
|
|
756
|
+
* @param body - Response body
|
|
757
|
+
* @param generateEtag - Whether to generate ETag header
|
|
581
758
|
*/
|
|
582
759
|
requestEntityTooLarge(body?: any, generateEtag?: boolean): void;
|
|
583
760
|
/**
|
|
584
|
-
*
|
|
761
|
+
* Sends a 414 URI Too Long response
|
|
762
|
+
*
|
|
763
|
+
* @param body - Response body
|
|
764
|
+
* @param generateEtag - Whether to generate ETag header
|
|
585
765
|
*/
|
|
586
766
|
requestUriTooLong(body?: any, generateEtag?: boolean): void;
|
|
587
767
|
/**
|
|
588
|
-
*
|
|
768
|
+
* Sends a 415 Unsupported Media Type response
|
|
769
|
+
*
|
|
770
|
+
* @param body - Response body
|
|
771
|
+
* @param generateEtag - Whether to generate ETag header
|
|
589
772
|
*/
|
|
590
773
|
unsupportedMediaType(body?: any, generateEtag?: boolean): void;
|
|
591
774
|
/**
|
|
592
|
-
*
|
|
775
|
+
* Sends a 416 Range Not Satisfiable response
|
|
776
|
+
*
|
|
777
|
+
* @param body - Response body
|
|
778
|
+
* @param generateEtag - Whether to generate ETag header
|
|
593
779
|
*/
|
|
594
780
|
requestedRangeNotSatisfiable(body?: any, generateEtag?: boolean): void;
|
|
595
781
|
/**
|
|
596
|
-
*
|
|
782
|
+
* Sends a 417 Expectation Failed response
|
|
783
|
+
*
|
|
784
|
+
* @param body - Response body
|
|
785
|
+
* @param generateEtag - Whether to generate ETag header
|
|
597
786
|
*/
|
|
598
787
|
expectationFailed(body?: any, generateEtag?: boolean): void;
|
|
599
788
|
/**
|
|
600
|
-
*
|
|
789
|
+
* Sends a 422 Unprocessable Entity response
|
|
790
|
+
*
|
|
791
|
+
* @param body - Response body
|
|
792
|
+
* @param generateEtag - Whether to generate ETag header
|
|
601
793
|
*/
|
|
602
794
|
unprocessableEntity(body?: any, generateEtag?: boolean): void;
|
|
603
795
|
/**
|
|
604
|
-
*
|
|
796
|
+
* Sends a 429 Too Many Requests response
|
|
797
|
+
*
|
|
798
|
+
* @param body - Response body
|
|
799
|
+
* @param generateEtag - Whether to generate ETag header
|
|
605
800
|
*/
|
|
606
801
|
tooManyRequests(body?: any, generateEtag?: boolean): void;
|
|
607
802
|
/**
|
|
608
|
-
*
|
|
803
|
+
* Sends a 500 Internal Server Error response
|
|
804
|
+
*
|
|
805
|
+
* @param body - Response body
|
|
806
|
+
* @param generateEtag - Whether to generate ETag header
|
|
609
807
|
*/
|
|
610
808
|
internalServerError(body?: any, generateEtag?: boolean): void;
|
|
611
809
|
/**
|
|
612
|
-
*
|
|
810
|
+
* Sends a 501 Not Implemented response
|
|
811
|
+
*
|
|
812
|
+
* @param body - Response body
|
|
813
|
+
* @param generateEtag - Whether to generate ETag header
|
|
613
814
|
*/
|
|
614
815
|
notImplemented(body?: any, generateEtag?: boolean): void;
|
|
615
816
|
/**
|
|
616
|
-
*
|
|
817
|
+
* Sends a 502 Bad Gateway response
|
|
818
|
+
*
|
|
819
|
+
* @param body - Response body
|
|
820
|
+
* @param generateEtag - Whether to generate ETag header
|
|
617
821
|
*/
|
|
618
822
|
badGateway(body?: any, generateEtag?: boolean): void;
|
|
619
823
|
/**
|
|
620
|
-
*
|
|
824
|
+
* Sends a 503 Service Unavailable response
|
|
825
|
+
*
|
|
826
|
+
* @param body - Response body
|
|
827
|
+
* @param generateEtag - Whether to generate ETag header
|
|
621
828
|
*/
|
|
622
829
|
serviceUnavailable(body?: any, generateEtag?: boolean): void;
|
|
623
830
|
/**
|
|
624
|
-
*
|
|
831
|
+
* Sends a 504 Gateway Timeout response
|
|
832
|
+
*
|
|
833
|
+
* @param body - Response body
|
|
834
|
+
* @param generateEtag - Whether to generate ETag header
|
|
625
835
|
*/
|
|
626
836
|
gatewayTimeout(body?: any, generateEtag?: boolean): void;
|
|
627
837
|
/**
|
|
628
|
-
*
|
|
838
|
+
* Sends a 505 HTTP Version Not Supported response
|
|
839
|
+
*
|
|
840
|
+
* @param body - Response body
|
|
841
|
+
* @param generateEtag - Whether to generate ETag header
|
|
629
842
|
*/
|
|
630
843
|
httpVersionNotSupported(body?: any, generateEtag?: boolean): void;
|
|
631
844
|
}
|