@shopify/remix-oxygen
Advanced tools
Comparing version 2.0.6 to 2.0.7
@@ -103,2 +103,11 @@ import { createCookieFactory, createCookieSessionStorageFactory, createSessionStorageFactory, createMemorySessionStorageFactory, createRequestHandler as createRequestHandler$1 } from '@remix-run/server-runtime'; | ||
} | ||
const url = new URL(request.url); | ||
if (url.pathname.includes("//")) { | ||
return new Response(null, { | ||
status: 301, | ||
headers: { | ||
location: url.pathname.replace(/\/+/g, "/") | ||
} | ||
}); | ||
} | ||
const context = getLoadContext ? await getLoadContext(request) : void 0; | ||
@@ -105,0 +114,0 @@ if (context) { |
import { createCookieFactory, createCookieSessionStorageFactory, createSessionStorageFactory, createMemorySessionStorageFactory, createRequestHandler } from '@remix-run/server-runtime'; | ||
export { MaxPartSizeExceededError, createSession, defer, isCookie, isSession, json, redirect, redirectDocument, unstable_composeUploadHandlers, unstable_createMemoryUploadHandler, unstable_defineAction, unstable_defineLoader, unstable_parseMultipartFormData } from '@remix-run/server-runtime'; | ||
var c=new TextEncoder,d=async(e,t)=>{let r=await g(t,["sign"]),n=c.encode(e),s=await crypto.subtle.sign("HMAC",r,n),o=btoa(String.fromCharCode(...new Uint8Array(s))).replace(/=+$/,"");return e+"."+o},l=async(e,t)=>{let r=e.lastIndexOf("."),n=e.slice(0,r),s=e.slice(r+1),o=await g(t,["verify"]),a=c.encode(n),i=m(atob(s));return await crypto.subtle.verify("HMAC",o,i,a)?n:!1};async function g(e,t){return await crypto.subtle.importKey("raw",c.encode(e),{name:"HMAC",hash:"SHA-256"},!1,t)}function m(e){let t=new Uint8Array(e.length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t}var u=createCookieFactory({sign:d,unsign:l}),h=createCookieSessionStorageFactory(u),y=createSessionStorageFactory(u),F=createMemorySessionStorageFactory(y);var A=Error.prototype.toString;Error.prototype.toString=function(){return this.stack||A.call(this)};function E({build:e,mode:t,poweredByHeader:r=!0,getLoadContext:n}){let s=createRequestHandler(e,t);return async o=>{let a=o.method;if((a==="GET"||a==="HEAD")&&o.body)return new Response(`${a} requests cannot have a body`,{status:400});let i=n?await n(o):void 0,p=await s(o,i);return r&&p.headers.append("powered-by","Shopify, Hydrogen"),p}}function v(e){let t=e.headers;return {requestGroupId:t.get("request-id"),buyerIp:t.get("oxygen-buyer-ip"),cookie:t.get("cookie"),purpose:t.get("purpose")}} | ||
var c=new TextEncoder,l=async(e,t)=>{let r=await y(t,["sign"]),n=c.encode(e),s=await crypto.subtle.sign("HMAC",r,n),o=btoa(String.fromCharCode(...new Uint8Array(s))).replace(/=+$/,"");return e+"."+o},g=async(e,t)=>{let r=e.lastIndexOf("."),n=e.slice(0,r),s=e.slice(r+1),o=await y(t,["verify"]),a=c.encode(n),i=m(atob(s));return await crypto.subtle.verify("HMAC",o,i,a)?n:!1};async function y(e,t){return await crypto.subtle.importKey("raw",c.encode(e),{name:"HMAC",hash:"SHA-256"},!1,t)}function m(e){let t=new Uint8Array(e.length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t}var u=createCookieFactory({sign:l,unsign:g}),C=createCookieSessionStorageFactory(u),S=createSessionStorageFactory(u),F=createMemorySessionStorageFactory(S);var A=Error.prototype.toString;Error.prototype.toString=function(){return this.stack||A.call(this)};function E({build:e,mode:t,poweredByHeader:r=!0,getLoadContext:n}){let s=createRequestHandler(e,t);return async o=>{let a=o.method;if((a==="GET"||a==="HEAD")&&o.body)return new Response(`${a} requests cannot have a body`,{status:400});let i=new URL(o.url);if(i.pathname.includes("//"))return new Response(null,{status:301,headers:{location:i.pathname.replace(/\/+/g,"/")}});let p=n?await n(o):void 0,d=await s(o,p);return r&&d.headers.append("powered-by","Shopify, Hydrogen"),d}}function v(e){let t=e.headers;return {requestGroupId:t.get("request-id"),buyerIp:t.get("oxygen-buyer-ip"),cookie:t.get("cookie"),purpose:t.get("purpose")}} | ||
export { u as createCookie, h as createCookieSessionStorage, F as createMemorySessionStorage, E as createRequestHandler, y as createSessionStorage, v as getStorefrontHeaders }; | ||
export { u as createCookie, C as createCookieSessionStorage, F as createMemorySessionStorage, E as createRequestHandler, S as createSessionStorage, v as getStorefrontHeaders }; | ||
//# sourceMappingURL=out.js.map | ||
//# sourceMappingURL=index.js.map |
@@ -8,3 +8,3 @@ { | ||
"type": "module", | ||
"version": "2.0.6", | ||
"version": "2.0.7", | ||
"license": "MIT", | ||
@@ -11,0 +11,0 @@ "main": "dist/index.cjs", |
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
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
66858
447