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

@remix-run/cloudflare-pages

Package Overview
Dependencies
Maintainers
2
Versions
1026
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@remix-run/cloudflare-pages - npm Package Compare versions

Comparing version 0.0.0-experimental-56ff64d1 to 0.0.0-experimental-d8d46263

2

cookieSigning.js
/**
* @remix-run/cloudflare-pages v0.0.0-experimental-56ff64d1
* @remix-run/cloudflare-pages v0.0.0-experimental-d8d46263
*

@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc.

/**
* @remix-run/cloudflare-pages v0.0.0-experimental-56ff64d1
* @remix-run/cloudflare-pages v0.0.0-experimental-d8d46263
*

@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc.

/**
* @remix-run/cloudflare-pages v0.0.0-experimental-56ff64d1
* @remix-run/cloudflare-pages v0.0.0-experimental-d8d46263
*

@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc.

/**
* @remix-run/cloudflare-pages v0.0.0-experimental-56ff64d1
* @remix-run/cloudflare-pages v0.0.0-experimental-d8d46263
*

@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc.

/**
* @remix-run/cloudflare-pages v0.0.0-experimental-56ff64d1
* @remix-run/cloudflare-pages v0.0.0-experimental-d8d46263
*

@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc.

/**
* @remix-run/cloudflare-pages v0.0.0-experimental-56ff64d1
* @remix-run/cloudflare-pages v0.0.0-experimental-d8d46263
*

@@ -11,2 +11,3 @@ * Copyright (c) Remix Software Inc.

*/
import { getType } from 'mime';
import { createRequestHandler as createRequestHandler$1 } from '@remix-run/server-runtime';

@@ -26,9 +27,2 @@

}
async function handleAsset(request, env) {
let envWithAssets = env;
const response = await envWithAssets.ASSETS.fetch(request);
if (response.ok) return response;
}
function createFetchHandler({

@@ -48,5 +42,17 @@ build,

let url = new URL(context.request.url);
response = // TODO: Remove this once a fix has been meged to wranger@v2
process.env.NODE_ENV === "development" && url.pathname === "/" ? undefined : await handleAsset(context.request.clone(), context.env);
try {
response = await context.next();
response = response.ok ? response : undefined;
} catch {} // This is a known CF bug in the Pages runtime
if (response) {
let contentType = getType(url.pathname);
if (contentType) {
response.headers.set("Content-Type", contentType);
}
}
if (!response) {

@@ -53,0 +59,0 @@ response = await handleRequest(context);

/**
* @remix-run/cloudflare-pages v0.0.0-experimental-56ff64d1
* @remix-run/cloudflare-pages v0.0.0-experimental-d8d46263
*

@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc.

/**
* @remix-run/cloudflare-pages v0.0.0-experimental-56ff64d1
* @remix-run/cloudflare-pages v0.0.0-experimental-d8d46263
*

@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc.

/**
* @remix-run/cloudflare-pages v0.0.0-experimental-56ff64d1
* @remix-run/cloudflare-pages v0.0.0-experimental-d8d46263
*

@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc.

/**
* @remix-run/cloudflare-pages v0.0.0-experimental-56ff64d1
* @remix-run/cloudflare-pages v0.0.0-experimental-d8d46263
*

@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc.

{
"name": "@remix-run/cloudflare-pages",
"description": "Cloudflare Pages request handler for Remix",
"version": "0.0.0-experimental-56ff64d1",
"version": "0.0.0-experimental-d8d46263",
"license": "MIT",

@@ -17,3 +17,4 @@ "main": "./index.js",

"dependencies": {
"@remix-run/server-runtime": "0.0.0-experimental-56ff64d1"
"@remix-run/server-runtime": "0.0.0-experimental-d8d46263",
"mime": "^3.0.0"
},

@@ -24,4 +25,5 @@ "peerDependencies": {

"devDependencies": {
"@cloudflare/workers-types": "^3.2.0"
"@cloudflare/workers-types": "^3.2.0",
"@types/mime": "^2.0.3"
}
}
/**
* @remix-run/cloudflare-pages v0.0.0-experimental-56ff64d1
* @remix-run/cloudflare-pages v0.0.0-experimental-d8d46263
*

@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc.

/**
* @remix-run/cloudflare-pages v0.0.0-experimental-56ff64d1
* @remix-run/cloudflare-pages v0.0.0-experimental-d8d46263
*

@@ -15,2 +15,3 @@ * Copyright (c) Remix Software Inc.

var mime = require('mime');
var serverRuntime = require('@remix-run/server-runtime');

@@ -30,9 +31,2 @@

}
async function handleAsset(request, env) {
let envWithAssets = env;
const response = await envWithAssets.ASSETS.fetch(request);
if (response.ok) return response;
}
function createFetchHandler({

@@ -52,5 +46,17 @@ build,

let url = new URL(context.request.url);
response = // TODO: Remove this once a fix has been meged to wranger@v2
process.env.NODE_ENV === "development" && url.pathname === "/" ? undefined : await handleAsset(context.request.clone(), context.env);
try {
response = await context.next();
response = response.ok ? response : undefined;
} catch {} // This is a known CF bug in the Pages runtime
if (response) {
let contentType = mime.getType(url.pathname);
if (contentType) {
response.headers.set("Content-Type", contentType);
}
}
if (!response) {

@@ -57,0 +63,0 @@ response = await handleRequest(context);

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