@graphql-yoga/plugin-csrf-prevention 2.0.3 → 2.0.4-alpha-20230810153432-d9f7d423
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/cjs/index.js +1 -1
- package/esm/index.js +1 -1
- package/package.json +2 -2
package/cjs/index.js
CHANGED
|
@@ -17,7 +17,7 @@ function useCSRFPrevention(options = {}) {
|
|
|
17
17
|
const { requestHeaders = ['x-graphql-yoga-csrf'] } = options;
|
|
18
18
|
return {
|
|
19
19
|
async onRequestParse({ request }) {
|
|
20
|
-
if (!requestHeaders.some(
|
|
20
|
+
if (!requestHeaders.some(headerName => request.headers.has(headerName))) {
|
|
21
21
|
throw (0, graphql_yoga_1.createGraphQLError)('Required CSRF header(s) not present', {
|
|
22
22
|
extensions: {
|
|
23
23
|
http: {
|
package/esm/index.js
CHANGED
|
@@ -14,7 +14,7 @@ export function useCSRFPrevention(options = {}) {
|
|
|
14
14
|
const { requestHeaders = ['x-graphql-yoga-csrf'] } = options;
|
|
15
15
|
return {
|
|
16
16
|
async onRequestParse({ request }) {
|
|
17
|
-
if (!requestHeaders.some(
|
|
17
|
+
if (!requestHeaders.some(headerName => request.headers.has(headerName))) {
|
|
18
18
|
throw createGraphQLError('Required CSRF header(s) not present', {
|
|
19
19
|
extensions: {
|
|
20
20
|
http: {
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphql-yoga/plugin-csrf-prevention",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.4-alpha-20230810153432-d9f7d423",
|
|
4
4
|
"description": "CSRF prevention plugin for GraphQL Yoga that requires the clients to have a specific header set.",
|
|
5
5
|
"peerDependencies": {
|
|
6
|
-
"graphql-yoga": "
|
|
6
|
+
"graphql-yoga": "4.0.4-alpha-20230810153432-d9f7d423"
|
|
7
7
|
},
|
|
8
8
|
"repository": {
|
|
9
9
|
"type": "git",
|