@sveltejs/adapter-cloudflare-workers
Advanced tools
Comparing version 1.0.0-next.38 to 1.0.0-next.39
@@ -63,12 +63,8 @@ import { Server } from 'SERVER'; | ||
// dynamically-generated pages | ||
try { | ||
return await server.respond(req, { | ||
platform: { env, context }, | ||
getClientAddress() { | ||
return req.headers.get('cf-connecting-ip'); | ||
} | ||
}); | ||
} catch (e) { | ||
return new Response('Error rendering route: ' + (e.message || e.toString()), { status: 500 }); | ||
} | ||
return await server.respond(req, { | ||
platform: { env, context }, | ||
getClientAddress() { | ||
return req.headers.get('cf-connecting-ip'); | ||
} | ||
}); | ||
} | ||
@@ -83,20 +79,15 @@ }; | ||
async function get_asset_from_kv(req, env, context, map = mapRequestToAsset) { | ||
try { | ||
return await getAssetFromKV( | ||
{ | ||
request: req, | ||
waitUntil(promise) { | ||
return context.waitUntil(promise); | ||
} | ||
}, | ||
{ | ||
ASSET_NAMESPACE: env.__STATIC_CONTENT, | ||
ASSET_MANIFEST: static_asset_manifest, | ||
mapRequestToAsset: map | ||
return await getAssetFromKV( | ||
{ | ||
request: req, | ||
waitUntil(promise) { | ||
return context.waitUntil(promise); | ||
} | ||
); | ||
} catch (e) { | ||
const status = is_error(e.status) ? e.status : 500; | ||
return new Response(e.message || e.toString(), { status }); | ||
} | ||
}, | ||
{ | ||
ASSET_NAMESPACE: env.__STATIC_CONTENT, | ||
ASSET_MANIFEST: static_asset_manifest, | ||
mapRequestToAsset: map | ||
} | ||
); | ||
} | ||
@@ -103,0 +94,0 @@ |
@@ -149,3 +149,3 @@ import { existsSync, readFileSync, writeFileSync } from 'fs'; | ||
[build] | ||
command = "" | ||
command = "" | ||
@@ -152,0 +152,0 @@ [build.upload] |
{ | ||
"name": "@sveltejs/adapter-cloudflare-workers", | ||
"version": "1.0.0-next.38", | ||
"version": "1.0.0-next.39", | ||
"repository": { | ||
@@ -5,0 +5,0 @@ "type": "git", |
@@ -26,5 +26,5 @@ # adapter-cloudflare-workers | ||
export default { | ||
kit: { | ||
adapter: adapter() | ||
} | ||
kit: { | ||
adapter: adapter() | ||
} | ||
}; | ||
@@ -31,0 +31,0 @@ ``` |
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
12432
224