Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@sveltejs/adapter-cloudflare-workers

Package Overview
Dependencies
Maintainers
4
Versions
101
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sveltejs/adapter-cloudflare-workers - npm Package Compare versions

Comparing version 1.2.0 to 1.2.1

40

files/entry.js

@@ -43,20 +43,25 @@ import { Server } from 'SERVER';

// prerendered pages and index.html files
const pathname = url.pathname.replace(/\/$/, '');
let file = pathname.substring(1);
let { pathname } = url;
try {
file = decodeURIComponent(file);
} catch (err) {
// ignore
pathname = decodeURIComponent(pathname);
} catch {
// ignore invalid URI
}
if (
manifest.assets.has(file) ||
manifest.assets.has(file + '/index.html') ||
prerendered.has(pathname || '/')
) {
const stripped_pathname = pathname.replace(/\/$/, '');
// prerendered pages and /static files
let is_static_asset = false;
const filename = stripped_pathname.substring(1);
if (filename) {
is_static_asset =
manifest.assets.has(filename) || manifest.assets.has(filename + '/index.html');
}
const location = pathname.at(-1) === '/' ? stripped_pathname : pathname + '/';
if (is_static_asset || prerendered.has(pathname)) {
return get_asset_from_kv(req, env, context, (request, options) => {
if (prerendered.has(pathname || '/')) {
url.pathname = '/' + prerendered.get(pathname || '/').file;
if (prerendered.has(pathname)) {
url.pathname = '/' + prerendered.get(pathname).file;
return new Request(url.toString(), request);

@@ -67,2 +72,9 @@ }

});
} else if (location && prerendered.has(location)) {
return new Response('', {
status: 308,
headers: {
location
}
});
}

@@ -69,0 +81,0 @@

@@ -17,3 +17,3 @@ import { existsSync, readFileSync, writeFileSync } from 'node:fs';

/** @type {import('.').default} */
/** @type {import('./index.js').default} */
export default function ({ config = 'wrangler.toml' } = {}) {

@@ -20,0 +20,0 @@ return {

{
"name": "@sveltejs/adapter-cloudflare-workers",
"version": "1.2.0",
"version": "1.2.1",
"description": "SvelteKit adapter that creates a Cloudflare Workers site using a function for dynamic server rendering",

@@ -5,0 +5,0 @@ "repository": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc