🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

@react-router/express

Package Overview
Dependencies
Maintainers
1
Versions
430
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@react-router/express - npm Package Compare versions

Comparing version

to
0.0.0-experimental-762485b

116

CHANGELOG.md
# `@react-router/express`
## 7.6.1
### Patch Changes
- Updated dependencies:
- `react-router@7.6.1`
- `@react-router/node@7.6.1`
## 7.6.0
### Patch Changes
- Updated dependencies:
- `react-router@7.6.0`
- `@react-router/node@7.6.0`
## 7.5.3
### Patch Changes
- Updated dependencies:
- `react-router@7.5.3`
- `@react-router/node@7.5.3`
## 7.5.2
### Patch Changes
- Updated dependencies:
- `react-router@7.5.2`
- `@react-router/node@7.5.2`
## 7.5.1
### Patch Changes
- Updated dependencies:
- `react-router@7.5.1`
- `@react-router/node@7.5.1`
## 7.5.0
### Patch Changes
- Updated dependencies:
- `react-router@7.5.0`
- `@react-router/node@7.5.0`
## 7.4.1
### Patch Changes
- Better validation of `x-forwarded-host` header to preent potential security issues. ([#13309](https://github.com/remix-run/react-router/pull/13309))
- Updated dependencies:
- `react-router@7.4.1`
- `@react-router/node@7.4.1`
## 7.4.0
### Patch Changes
- Updated dependencies:
- `react-router@7.4.0`
- `@react-router/node@7.4.0`
## 7.3.0
### Patch Changes
- Update `express` `peerDependency` to include v5 (<https://github.com/remix-run/react-router/pull/13064>) ([#12961](https://github.com/remix-run/react-router/pull/12961))
- Updated dependencies:
- `react-router@7.3.0`
- `@react-router/node@7.3.0`
## 7.2.0
### Patch Changes
- Updated dependencies:
- `react-router@7.2.0`
- `@react-router/node@7.2.0`
## 7.1.5
### Patch Changes
- Updated dependencies:
- `react-router@7.1.5`
- `@react-router/node@7.1.5`
## 7.1.4
### Patch Changes
- Updated dependencies:
- `react-router@7.1.4`
- `@react-router/node@7.1.4`
## 7.1.3
### Patch Changes
- Updated dependencies:
- `react-router@7.1.3`
- `@react-router/node@7.1.3`
## 7.1.2
### Patch Changes
- Updated dependencies:
- `react-router@7.1.2`
- `@react-router/node@7.1.2`
## 7.1.1

@@ -39,3 +153,3 @@

- Remove single_fetch future flag. ([#11522](https://github.com/remix-run/react-router/pull/11522))
- Remove single fetch future flag. ([#11522](https://github.com/remix-run/react-router/pull/11522))
- update minimum node version to 18 ([#11690](https://github.com/remix-run/react-router/pull/11690))

@@ -42,0 +156,0 @@ - Add `exports` field to all packages ([#11675](https://github.com/remix-run/react-router/pull/11675))

5

dist/index.d.ts
import * as express from 'express';
import { AppLoadContext, ServerBuild } from 'react-router';
import { UNSAFE_MiddlewareEnabled, unstable_InitialContext, AppLoadContext, ServerBuild } from 'react-router';
/// <reference lib="dom.iterable" />
type MaybePromise<T> = T | Promise<T>;
/**

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

*/
type GetLoadContextFunction = (req: express.Request, res: express.Response) => Promise<AppLoadContext> | AppLoadContext;
type GetLoadContextFunction = (req: express.Request, res: express.Response) => UNSAFE_MiddlewareEnabled extends true ? MaybePromise<unstable_InitialContext> : MaybePromise<AppLoadContext>;
type RequestHandler = (req: express.Request, res: express.Response, next: express.NextFunction) => Promise<void>;

@@ -17,0 +18,0 @@ /**

/**
* @react-router/express v0.0.0-experimental-759a11a62
* @react-router/express v0.0.0-experimental-762485b
*

@@ -73,5 +73,7 @@ * Copyright (c) Remix Software Inc.

function createRemixRequest(req, res) {
let [, hostnamePort] = req.get("X-Forwarded-Host")?.split(":") ?? [];
let [, hostPort] = req.get("host")?.split(":") ?? [];
let port = hostnamePort || hostPort;
let [, hostnamePortStr] = req.get("X-Forwarded-Host")?.split(":") ?? [];
let [, hostPortStr] = req.get("host")?.split(":") ?? [];
let hostnamePort = Number.parseInt(hostnamePortStr, 10);
let hostPort = Number.parseInt(hostPortStr, 10);
let port = Number.isSafeInteger(hostnamePort) ? hostnamePort : Number.isSafeInteger(hostPort) ? hostPort : "";
let resolvedHost = `${req.hostname}${port ? `:${port}` : ""}`;

@@ -78,0 +80,0 @@ let url = new URL(`${req.protocol}://${resolvedHost}${req.originalUrl}`);

{
"name": "@react-router/express",
"version": "0.0.0-experimental-759a11a62",
"version": "0.0.0-experimental-762485b",
"description": "Express server request handler for React Router",

@@ -48,3 +48,3 @@ "bugs": {

"dependencies": {
"@react-router/node": "0.0.0-experimental-759a11a62"
"@react-router/node": "0.0.0-experimental-762485b"
},

@@ -63,5 +63,5 @@ "devDependencies": {

"peerDependencies": {
"express": "^4.17.1",
"express": "^4.17.1 || ^5",
"typescript": "^5.1.0",
"react-router": "0.0.0-experimental-759a11a62"
"react-router": "0.0.0-experimental-762485b"
},

@@ -83,4 +83,5 @@ "peerDependenciesMeta": {

"scripts": {
"build": "wireit"
"build": "wireit",
"typecheck": "tsc"
}
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet