Skip to content

Commit af1d126

Browse files
authored
Merge pull request #47 from jagaapple/release/v2.2.0
# New Features - Add navigation directives #41 - Move to `navigation-to` directive from `ReportingDirective` to `NavigationDirective` - Add about frame-ancestors CSP directive to readme #46 # Changes and Fixes - Modify English in readme - Update dev dependencies
2 parents 87f6129 + ff95b9e commit af1d126

File tree

6 files changed

+494
-282
lines changed

6 files changed

+494
-282
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
11
# Changelog
2+
## 2.2.0 (2021-02-25)
3+
- Add navigation directives #41 - [@naotone](https://github.com/naotone)
4+
- Support `form-action` `frame-ancestors` directives
5+
- Move to `navigation-to` directive from ReportingDirective to NavigationDirective
6+
- Add about frame-ancestors CSP directive to readme #46 - [@mattdell](https://github.com/mattdell)
7+
- Improve development environment
8+
- Update dependencies - [@jagaapple](https://github.com/jagaapple)
9+
210
## 2.1.0 (2020-12-27)
311
- Add support for Node.js 14 #36 - [@jagaapple](https://github.com/jagaapple)
412
- Add support for chain-case directive styles to CSP #40 - [@jagaapple](https://github.com/jagaapple)

README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ was born. next-secure-headers is built for Next.js project so that you can speci
101101
components.
102102

103103
#### next-secure-headers vs Helmet
104-
The following are rules next-secure-headers has and Helmet has. next-secure-headers is inspired by Helmet, but it don't have
104+
The following are rules next-secure-headers has and Helmet has. next-secure-headers is inspired by Helmet, but it doesn't have
105105
some rules for some reason.
106106

107107
| | next-secure-headers | Helmet | Comment |
@@ -355,6 +355,8 @@ blocks many XSS attacks, but Content Security Policy is recommended to use compa
355355
| "allow-top-navigation-by-user-activation";
356356
}>
357357
& Partial<{
358+
formAction: string | string[];
359+
frameAncestors: string | string[];
358360
navigateTo: string | string[];
359361
reportURI: string | URL | (string | URL)[];
360362
reportTo: string;
@@ -375,6 +377,11 @@ If you give true to `reportOnly` , this sets "Content-Security-Policy-Report-Onl
375377

376378
Also you can specify directives using chain-case names such as `child-src` instead of `childSrc` .
377379

380+
> **❗️ When setting `frameAncestors` :X-Frame-Options takes priority.**
381+
> [Section "Relation to X-Frame-Options" of the CSP Spec](https://w3c.github.io/webappsec-csp/#frame-ancestors-and-frame-options) says: _"If a resource is delivered with a policy that includes a directive named frame-ancestors and whose disposition is "enforce", then the X-Frame-Options header MUST be ignored"_, but Chrome 40 & Firefox 35 ignore the frame-ancestors directive and follow the X-Frame-Options header instead.
382+
>
383+
> Therefore, if setting `frameAncestors` you should set `frameGuard` to `false`.
384+
378385
### `expectCT`
379386
```ts
380387
{

0 commit comments

Comments
 (0)