File tree 5 files changed +35
-9
lines changed
5 files changed +35
-9
lines changed Original file line number Diff line number Diff line change @@ -316,7 +316,7 @@ export interface ResponseObject extends Podium {
316
316
* Only available after calling the response.redirect() method.
317
317
* [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-responsetemporaryistemporary)
318
318
*/
319
- temporary ( isTemporary : boolean ) : ResponseObject ;
319
+ temporary ( isTemporary ? : boolean ) : ResponseObject ;
320
320
321
321
/**
322
322
* Sets the status code to 301 or 308 (based on the response.rewritable() setting) where:
@@ -325,7 +325,7 @@ export interface ResponseObject extends Podium {
325
325
* Only available after calling the response.redirect() method.
326
326
* [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-responsepermanentispermanent)
327
327
*/
328
- permanent ( isPermanent : boolean ) : ResponseObject ;
328
+ permanent ( isPermanent ? : boolean ) : ResponseObject ;
329
329
330
330
/**
331
331
* Sets the status code to 301/302 for rewritable (allows changing the request method from 'POST' to 'GET') or 307/308 for non-rewritable (does not allow changing the request method from 'POST'
@@ -335,7 +335,7 @@ export interface ResponseObject extends Podium {
335
335
* Only available after calling the response.redirect() method.
336
336
* [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-responserewritableisrewritable)
337
337
*/
338
- rewritable ( isRewritable : boolean ) : ResponseObject ;
338
+ rewritable ( isRewritable ? : boolean ) : ResponseObject ;
339
339
}
340
340
341
341
/**
Original file line number Diff line number Diff line change @@ -187,6 +187,10 @@ export interface RouteOptionsCors {
187
187
* if true, allows user credentials to be sent ('Access-Control-Allow-Credentials'). Defaults to false.
188
188
*/
189
189
credentials ?: boolean | undefined ;
190
+ /**
191
+ * the status code used for CORS preflight responses, either 200 or 204. Defaults to 200.
192
+ */
193
+ preflightStatusCode ?: 200 | 204 ;
190
194
}
191
195
192
196
/**
@@ -309,6 +313,13 @@ export interface RouteOptionsPayload {
309
313
*/
310
314
parse ?: boolean | 'gunzip' | undefined ;
311
315
316
+ /**
317
+ * @default to 'error'.
318
+ * Sets handling of incoming payload that may contain a prototype poisoning security attack.
319
+ * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-routeoptionspayloadprotoaction)
320
+ */
321
+ protoAction ?: 'error' | 'remove' | 'ignore' ;
322
+
312
323
/**
313
324
* @default to 10000 (10 seconds).
314
325
* Payload reception timeout in milliseconds. Sets the maximum time allowed for the client to transmit the request payload (body) before giving up and responding with a Request Timeout (408)
@@ -497,15 +508,15 @@ export interface RouteOptionsSecureObject {
497
508
/**
498
509
* the max-age portion of the header, as a number. Default is 15768000.
499
510
*/
500
- maxAge : number ;
511
+ maxAge ? : number ;
501
512
/**
502
513
* a boolean specifying whether to add the includeSubDomains flag to the header.
503
514
*/
504
- includeSubDomains : boolean ;
515
+ includeSubDomains ? : boolean ;
505
516
/**
506
517
* a boolean specifying whether to add the 'preload' flag (used to submit domains inclusion in Chrome's HTTP Strict Transport Security (HSTS) preload list) to the header.
507
518
*/
508
- preload : boolean ;
519
+ preload ? : boolean ;
509
520
} | undefined ;
510
521
/**
511
522
* controls the 'X-Frame-Options' header
Original file line number Diff line number Diff line change @@ -88,8 +88,8 @@ export interface ServerOptions {
88
88
* false.
89
89
*/
90
90
debug ?: false | {
91
- log ?: string [ ] | false | undefined ;
92
- request ?: string [ ] | false | undefined ;
91
+ log ?: string | string [ ] | false | undefined ;
92
+ request ?: string | string [ ] | false | undefined ;
93
93
} | undefined ;
94
94
95
95
/**
@@ -152,6 +152,19 @@ export interface ServerOptions {
152
152
*/
153
153
mime ?: MimosOptions | undefined ;
154
154
155
+ /**
156
+ * @default { cleanStop: true }
157
+ * Defines server handling of server operations.
158
+ */
159
+ operations ?: {
160
+ /**
161
+ * @default true
162
+ * If true, the server keeps track of open connections and properly closes them when the server is stopped.
163
+ * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-serveroptionsoperations)
164
+ */
165
+ cleanStop ?: boolean ;
166
+ }
167
+
155
168
/**
156
169
* @default {}.
157
170
* Plugin-specific configuration which can later be accessed via server.settings.plugins. plugins is an object where each key is a plugin name and the value is the configuration. Note the
Original file line number Diff line number Diff line change @@ -626,7 +626,7 @@ export class Server<A = ServerApplicationState> {
626
626
* * path - the route path.
627
627
* [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-servertablehost)
628
628
*/
629
- table ( host ?: string | undefined ) : RequestRoute [ ] ;
629
+ table ( host ?: string | string [ ] | undefined ) : RequestRoute [ ] ;
630
630
631
631
/**
632
632
* Registers a server validation module used to compile raw validation rules into validation schemas for all routes.
Original file line number Diff line number Diff line change @@ -66,6 +66,8 @@ export interface ServerStateCookieOptions {
66
66
strictHeader ?: boolean | undefined ;
67
67
/** used by proxy plugins (e.g. h2o2). */
68
68
passThrough ?: any | undefined ;
69
+ /** a function using the signature `async function(definition, request)` used to override a request-specific cookie settings */
70
+ contextualize ?( definition : ServerStateCookieOptions , request : Request ) : void | Promise < void > ;
69
71
}
70
72
71
73
/**
You can’t perform that action at this time.
0 commit comments