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

@remix-run/express

Package Overview
Dependencies
Maintainers
2
Versions
1030
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@remix-run/express - npm Package Compare versions

Comparing version 0.0.0-experimental-ab9dac4f to 0.0.0-experimental-b33ac4ef

2

globals.js
/**
* @remix-run/express v0.0.0-experimental-ab9dac4f
* @remix-run/express v0.0.0-experimental-b33ac4ef
*

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

/**
* @remix-run/express v0.0.0-experimental-ab9dac4f
* @remix-run/express v0.0.0-experimental-b33ac4ef
*

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

{
"name": "@remix-run/express",
"description": "Express server request handler for Remix",
"version": "0.0.0-experimental-ab9dac4f",
"version": "0.0.0-experimental-b33ac4ef",
"license": "MIT",

@@ -15,3 +15,4 @@ "repository": {

"dependencies": {
"@remix-run/node": "0.0.0-experimental-ab9dac4f"
"@remix-run/node": "0.0.0-experimental-b33ac4ef",
"@remix-run/server-runtime": "0.0.0-experimental-b33ac4ef"
},

@@ -18,0 +19,0 @@ "peerDependencies": {

import type * as express from "express";
import type { AppLoadContext, ServerBuild } from "@remix-run/server-runtime";
import { Headers as NodeHeaders, Request as NodeRequest } from "@remix-run/node";
import { AbortController, Headers as NodeHeaders, Request as NodeRequest } from "@remix-run/node";
/**

@@ -25,2 +25,2 @@ * A function that returns the value to use as `context` in route `loader` and

export declare function createRemixHeaders(requestHeaders: express.Request["headers"]): NodeHeaders;
export declare function createRemixRequest(req: express.Request): NodeRequest;
export declare function createRemixRequest(req: express.Request, abortController?: AbortController): NodeRequest;
/**
* @remix-run/express v0.0.0-experimental-ab9dac4f
* @remix-run/express v0.0.0-experimental-b33ac4ef
*

@@ -42,6 +42,7 @@ * Copyright (c) Remix Software Inc.

try {
let request = createRemixRequest(req);
let abortController = new node.AbortController();
let request = createRemixRequest(req, abortController);
let loadContext = typeof getLoadContext === "function" ? getLoadContext(req, res) : undefined;
let response = await handleRequest(request, loadContext);
sendRemixResponse(res, response);
sendRemixResponse(res, response, abortController);
} catch (error) {

@@ -71,3 +72,3 @@ // Express doesn't support async functions, so we have to pass along the

}
function createRemixRequest(req) {
function createRemixRequest(req, abortController) {
let origin = `${req.protocol}://${req.get("host")}`;

@@ -77,3 +78,5 @@ let url = new URL(req.url, origin);

method: req.method,
headers: createRemixHeaders(req.headers)
headers: createRemixHeaders(req.headers),
signal: abortController === null || abortController === void 0 ? void 0 : abortController.signal,
abortController
};

@@ -87,6 +90,6 @@

return new node.Request(url.toString(), init);
return new node.Request(url.href, init);
}
function sendRemixResponse(res, response) {
function sendRemixResponse(res, response, abortController) {
var _response$body;

@@ -102,2 +105,6 @@

if (abortController.signal.aborted) {
res.set("Connection", "close");
}
if (Buffer.isBuffer(response.body)) {

@@ -104,0 +111,0 @@ res.end(response.body);

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