Skip to content

Commit b857b9a

Browse files
authored
update types for xss
hapijs#4352 has changed the way xss behaves but the types were not updated yet.
1 parent 9c17cc0 commit b857b9a

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

lib/index.d.ts

+9-7
Original file line numberDiff line numberDiff line change
@@ -1689,9 +1689,10 @@ export type ReferrerPolicy = '' | 'no-referrer' | 'no-referrer-when-downgrade' |
16891689
* * * * * 'allow-from'
16901690
* * * * source - when rule is 'allow-from' this is used to form the rest of the header, otherwise this field is ignored. If rule is 'allow-from' but source is unset, the rule will be automatically
16911691
* changed to 'sameorigin'.
1692-
* * xss - boolean that controls the 'X-XSS-PROTECTION' header for Internet Explorer. Defaults to true which sets the header to equal '1; mode=block'.
1693-
* Note: this setting can create a security vulnerability in versions of Internet Explorer below 8, as well as unpatched versions of IE8. See here and here for more information. If you actively
1694-
* support old versions of IE, it may be wise to explicitly set this flag to false.
1692+
* * xss - controls the 'X-XSS-Protection' header, where:
1693+
* * * 'disable' - the header will be set to '0'. This is the default value.
1694+
* * * 'enable' - the header will be set to '1; mode=block'.
1695+
* * * false - the header will be omitted
16951696
* * noOpen - boolean controlling the 'X-Download-Options' header for Internet Explorer, preventing downloads from executing in your context. Defaults to true setting the header to 'noopen'.
16961697
* * noSniff - boolean controlling the 'X-Content-Type-Options' header. Defaults to true setting the header to its only and default option, 'nosniff'.
16971698
* [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-routeoptionssecurity)
@@ -1729,11 +1730,12 @@ export interface RouteOptionsSecureObject {
17291730
source: string;
17301731
} | undefined;
17311732
/**
1732-
* boolean that controls the 'X-XSS-PROTECTION' header for Internet Explorer. Defaults to true which sets the header to equal '1; mode=block'.
1733-
* Note: this setting can create a security vulnerability in versions of Internet Explorer below 8, as well as unpatched versions of IE8. See here and here for more information. If you actively
1734-
* support old versions of IE, it may be wise to explicitly set this flag to false.
1733+
* controls the 'X-XSS-Protection' header, where:
1734+
* * 'disable' - the header will be set to '0'. This is the default value.
1735+
* * 'enable' - the header will be set to '1; mode=block'.
1736+
* * false - the header will be omitted
17351737
*/
1736-
xss?: boolean | undefined;
1738+
xss?: 'disable' | 'enable' | false | undefined;
17371739
/**
17381740
* boolean controlling the 'X-Download-Options' header for Internet Explorer, preventing downloads from executing in your context. Defaults to true setting the header to 'noopen'.
17391741
*/

0 commit comments

Comments
 (0)