Skip to content

Commit ddce065

Browse files
committed
fix: conditionally set status message for HTTP/2 compatibility
1 parent ed77157 commit ddce065

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/react-router-dev/vite/node-adapter.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,11 @@ export function fromNodeRequest(
8686
// https://github.com/solidjs/solid-start/blob/7398163869b489cce503c167e284891cf51a6613/packages/start/node/fetch.js#L162-L185
8787
export async function toNodeRequest(res: Response, nodeRes: ServerResponse) {
8888
nodeRes.statusCode = res.status;
89-
nodeRes.statusMessage = res.statusText;
89+
90+
// HTTP/2 doesn't support status messages (RFC7540 8.1.2.4)
91+
if (!nodeRes.req || nodeRes.req.httpVersionMajor < 2) {
92+
nodeRes.statusMessage = res.statusText;
93+
}
9094

9195
let cookiesStrings = [];
9296

0 commit comments

Comments
 (0)