@sveltejs/adapter-cloudflare
Advanced tools
Comparing version 2.3.3 to 2.3.4
@@ -50,3 +50,3 @@ // src/worker.js | ||
return res; | ||
let { pathname } = new URL(req.url); | ||
let { pathname, search } = new URL(req.url); | ||
try { | ||
@@ -62,6 +62,8 @@ pathname = decodeURIComponent(pathname); | ||
} | ||
const location = pathname.at(-1) === "/" ? stripped_pathname : pathname + "/"; | ||
let location = pathname.at(-1) === "/" ? stripped_pathname : pathname + "/"; | ||
if (is_static_asset || prerendered.has(pathname)) { | ||
res = await env.ASSETS.fetch(req); | ||
} else if (location && prerendered.has(location)) { | ||
if (search) | ||
location += search; | ||
res = new Response("", { | ||
@@ -68,0 +70,0 @@ status: 308, |
@@ -6,3 +6,3 @@ import { writeFileSync } from 'node:fs'; | ||
/** @type {import('.').default} */ | ||
/** @type {import('./index.js').default} */ | ||
export default function (options = {}) { | ||
@@ -71,4 +71,4 @@ return { | ||
* @param {string[]} assets | ||
* @param {import('./index').AdapterOptions['routes']} routes | ||
* @returns {import('.').RoutesJSONSpec} | ||
* @param {import('./index.js').AdapterOptions['routes']} routes | ||
* @returns {import('./index.js').RoutesJSONSpec} | ||
*/ | ||
@@ -75,0 +75,0 @@ function get_routes_json(builder, assets, { include = ['/*'], exclude = ['<all>'] }) { |
{ | ||
"name": "@sveltejs/adapter-cloudflare", | ||
"version": "2.3.3", | ||
"version": "2.3.4", | ||
"description": "Adapter for building SvelteKit applications on Cloudflare Pages with Workers integration", | ||
@@ -45,3 +45,3 @@ "repository": { | ||
"build": "esbuild src/worker.js --bundle --outfile=files/worker.js --external:SERVER --external:MANIFEST --format=esm", | ||
"lint": "prettier --check . --config ../../.prettierrc --ignore-path .gitignore", | ||
"lint": "prettier --check .", | ||
"format": "pnpm lint --write", | ||
@@ -48,0 +48,0 @@ "check": "tsc --skipLibCheck" |
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
11310
260