New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@remix-run/express

Package Overview
Dependencies
Maintainers
2
Versions
1043
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-b697c4f3

2

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

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

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

@@ -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-b697c4f3",
"license": "MIT",

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

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

@@ -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-b697c4f3
*

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

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

@@ -43,6 +42,7 @@ var node = require('@remix-run/node');

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) {

@@ -72,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")}`;

@@ -78,9 +78,9 @@ 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
};
if (req.method !== "GET" && req.method !== "HEAD") {
init.body = req.pipe(new stream.PassThrough({
highWaterMark: 16384
}));
init.body = req; //req.pipe(new PassThrough({ highWaterMark: 16384 }));
}

@@ -91,3 +91,3 @@

function sendRemixResponse(res, response) {
function sendRemixResponse(res, response, abortController) {
var _response$body;

@@ -103,2 +103,6 @@

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

@@ -105,0 +109,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