Skip to content

Commit aedef7c

Browse files
authored
Correct type for state object (#4550)
1 parent 76e6cfe commit aedef7c

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

lib/types/server/options.d.ts

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { MimosOptions } from '@hapi/mimos';
66
import { PluginSpecificConfiguration } from '../plugin';
77
import { RouteOptions } from '../route';
88
import { CacheProvider, ServerOptionsCache } from './cache';
9-
import { SameSitePolicy } from './state';
9+
import { SameSitePolicy, ServerStateCookieOptions } from './state';
1010

1111
export interface ServerOptionsCompression {
1212
minBytes: number;
@@ -208,16 +208,7 @@ export interface ServerOptions {
208208
* }
209209
* Sets the default configuration for every state (cookie) set explicitly via server.state() or implicitly (without definition) using the state configuration object.
210210
*/
211-
// TODO I am not sure if I need to use all the server.state() definition (like the default value) OR only the options below. The v16 use "any" here.
212-
// state?: ServerStateCookieOptions;
213-
state?: {
214-
strictHeader?: boolean | undefined;
215-
ignoreErrors?: boolean | undefined;
216-
isSecure?: boolean | undefined;
217-
isHttpOnly?: boolean | undefined;
218-
isSameSite?: SameSitePolicy | undefined;
219-
encoding?: 'none' | 'base64' | 'base64json' | 'form' | 'iron' | undefined;
220-
} | undefined;
211+
state?: ServerStateCookieOptions | undefined;
221212

222213
/**
223214
* @default none.

0 commit comments

Comments
 (0)