fetch-metadata
Advanced tools
Comparing version 0.3.0 to 0.3.1
@@ -28,5 +28,5 @@ 'use strict'; | ||
return { | ||
secFetchSite: extractHeader(req, 'sec-fetch-site'), | ||
secFetchMode: extractHeader(req, 'sec-fetch-mode'), | ||
secFetchDest: extractHeader(req, 'sec-fetch-dest') | ||
secFetchSite: extractHeader(req, 'sec-fetch-site').toLowerCase(), | ||
secFetchMode: extractHeader(req, 'sec-fetch-mode').toLowerCase(), | ||
secFetchDest: extractHeader(req, 'sec-fetch-dest').toLowerCase() | ||
}; | ||
@@ -33,0 +33,0 @@ }; |
@@ -1,2 +0,2 @@ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=(e=require("url-pattern"))&&"object"==typeof e&&"default"in e?e.default:e,r={allowedFetchSites:["same-origin","same-site","none"],disallowedNavigationRequests:["object","embed"],allowedPaths:[],errorStatusCode:403,onError:function(e,t,r,o){t.statusCode=o.errorStatusCode,t.end()}},o=function(e,t){var r=e.headers[t];return Array.isArray(r)?r.join(","):r||""},s=function(e){return"string"==typeof e};function a(e){void 0===e&&(e={});var a=Object.assign(r,e);return function(e,r,i){var n,d=function(e){return{secFetchSite:o(e,"sec-fetch-site"),secFetchMode:o(e,"sec-fetch-mode"),secFetchDest:o(e,"sec-fetch-dest")}}(e),c=d.secFetchSite,u=d.secFetchMode,l=d.secFetchDest;return c?Array.isArray(a.allowedFetchSites)&&a.allowedFetchSites.includes(c)||"navigate"===u&&"GET"===(null===(n=e.method)||void 0===n?void 0:n.toUpperCase())&&Array.isArray(a.disallowedNavigationRequests)&&!a.disallowedNavigationRequests.includes(l)||function(e,r){if(!Array.isArray(e))return!1;var o=r.url,a=void 0===o?"":o,i=r.method,n=void 0===i?"":i;return n=n.toUpperCase(),!!e.find((function(e){var r=s(e)?{path:e}:e;return!(s(r.method)&&r.method.toUpperCase()!==n||!new t(r.path).match(a))}))}(a.allowedPaths,e)?i():void a.onError(e,r,i,a):i()}}module.exports=a,exports.default=a; | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=(e=require("url-pattern"))&&"object"==typeof e&&"default"in e?e.default:e,r={allowedFetchSites:["same-origin","same-site","none"],disallowedNavigationRequests:["object","embed"],allowedPaths:[],errorStatusCode:403,onError:function(e,t,r,o){t.statusCode=o.errorStatusCode,t.end()}},o=function(e,t){var r=e.headers[t];return Array.isArray(r)?r.join(","):r||""},s=function(e){return"string"==typeof e};function a(e){void 0===e&&(e={});var a=Object.assign(r,e);return function(e,r,i){var n,d=function(e){return{secFetchSite:o(e,"sec-fetch-site").toLowerCase(),secFetchMode:o(e,"sec-fetch-mode").toLowerCase(),secFetchDest:o(e,"sec-fetch-dest").toLowerCase()}}(e),c=d.secFetchSite,u=d.secFetchMode,l=d.secFetchDest;return c?Array.isArray(a.allowedFetchSites)&&a.allowedFetchSites.includes(c)||"navigate"===u&&"GET"===(null===(n=e.method)||void 0===n?void 0:n.toUpperCase())&&Array.isArray(a.disallowedNavigationRequests)&&!a.disallowedNavigationRequests.includes(l)||function(e,r){if(!Array.isArray(e))return!1;var o=r.url,a=void 0===o?"":o,i=r.method,n=void 0===i?"":i;return n=n.toUpperCase(),!!e.find((function(e){var r=s(e)?{path:e}:e;return!(s(r.method)&&r.method.toUpperCase()!==n||!new t(r.path).match(a))}))}(a.allowedPaths,e)?i():void a.onError(e,r,i,a):i()}}module.exports=a,exports.default=a; | ||
//# sourceMappingURL=fetch-metadata.cjs.production.min.js.map |
@@ -22,5 +22,5 @@ import UrlPattern from 'url-pattern'; | ||
return { | ||
secFetchSite: extractHeader(req, 'sec-fetch-site'), | ||
secFetchMode: extractHeader(req, 'sec-fetch-mode'), | ||
secFetchDest: extractHeader(req, 'sec-fetch-dest') | ||
secFetchSite: extractHeader(req, 'sec-fetch-site').toLowerCase(), | ||
secFetchMode: extractHeader(req, 'sec-fetch-mode').toLowerCase(), | ||
secFetchDest: extractHeader(req, 'sec-fetch-dest').toLowerCase() | ||
}; | ||
@@ -27,0 +27,0 @@ }; |
{ | ||
"version": "0.3.0", | ||
"version": "0.3.1", | ||
"license": "MIT", | ||
@@ -4,0 +4,0 @@ "main": "dist/index.js", |
@@ -43,5 +43,5 @@ import { IncomingMessage, ServerResponse } from 'http' | ||
return { | ||
secFetchSite: extractHeader(req, 'sec-fetch-site'), | ||
secFetchMode: extractHeader(req, 'sec-fetch-mode'), | ||
secFetchDest: extractHeader(req, 'sec-fetch-dest'), | ||
secFetchSite: extractHeader(req, 'sec-fetch-site').toLowerCase(), | ||
secFetchMode: extractHeader(req, 'sec-fetch-mode').toLowerCase(), | ||
secFetchDest: extractHeader(req, 'sec-fetch-dest').toLowerCase(), | ||
} | ||
@@ -48,0 +48,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
35671