-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🚨 [BUG] UnsupportedWarning: Status message is not supported by HTTP/2 (RFC7540 8.1.2.4) #12134
Comments
Hello @JakiChen. Please provide a minimal reproduction using a GitHub repository or StackBlitz. Issues marked with |
I'm guessing it's something to do with #12105 |
GitHub repository To enable local https, you must first install Currently, this bug only occurs in Astro version 4.15.11, and versions before 4.15.10 to 4.15.4 are all normal (so it is not clear whether this is a bug or a problem caused by my configuration) |
heyyy, @bluwy Currently, this issue has nothing to do with whether the local endpoint is used, but is related to enabling https through In addition, if you want to use {
"scripts": {
"dev": "NODE_EXTRA_CA_CERTS=config/certs/rootCA.crt astro dev",
}
} to work properly (but the bug still exists) |
Add this {
"scripts": {
"dev": "NODE_EXTRA_CA_CERTS=config/certs/rootCA.crt NODE_OPTIONS=\"--trace-warnings\" astro dev",
"start": "astro dev",
"build": "astro check && astro build",
"preview": "astro preview",
"astro": "astro"
},
} for detail (node:28145) UnsupportedWarning: Status message is not supported by HTTP/2 (RFC7540 8.1.2.4)
at statusMessageWarn (node:internal/http2/compat:115:13)
at set statusMessage [as statusMessage] (node:internal/http2/compat:697:5)
at writeWebResponse (file:///Users/JakiChen/Desktop/cloudflare/node_modules/astro/dist/vite-plugin-astro-server/response.js:49:21)
at writeSSRResult (file:///Users/JakiChen/Desktop/cloudflare/node_modules/astro/dist/vite-plugin-astro-server/response.js:81:10)
at handleRoute (file:///Users/JakiChen/Desktop/cloudflare/node_modules/astro/dist/vite-plugin-astro-server/route.js:214:9)
at async run (file:///Users/JakiChen/Desktop/cloudflare/node_modules/astro/dist/vite-plugin-astro-server/request.js:40:14)
at async runWithErrorHandling (file:///Users/JakiChen/Desktop/cloudflare/node_modules/astro/dist/vite-plugin-astro-server/controller.js:64:5)
at async handleRequest (file:///Users/JakiChen/Desktop/cloudflare/node_modules/astro/dist/vite-plugin-astro-server/request.js:34:3) |
Heyyyy, @ascorbic
|
在 Astro@4.15.12 的最新版本中好像依旧没有被修复, 现在只能靠自己手动去 async function writeWebResponse(res, webResponse) {
const { status, headers, body, statusText } = webResponse;
console.log(webResponse);
const setCookieHeaders = Array.from(getSetCookiesFromResponse(webResponse));
if (setCookieHeaders.length) {
res.setHeader("set-cookie", setCookieHeaders);
}
const _headers = Object.fromEntries(headers.entries());
if (headers.has("set-cookie")) {
_headers["set-cookie"] = headers.getSetCookie();
}
console.log(res);
// res.statusMessage = statusText;
res.writeHead(status, _headers);
if (body) {
if (Symbol.for("astro.responseBody") in webResponse) {
let stream = webResponse[Symbol.for("astro.responseBody")];
for await (const chunk of stream) {
res.write(chunk.toString());
}
} else if (body instanceof Readable) {
body.pipe(res);
return;
} else if (typeof body === "string") {
res.write(body);
} else {
const reader = body.getReader();
res.on("close", () => {
reader.cancel().catch(() => {
});
});
while (true) {
const { done, value } = await reader.read();
if (done) break;
if (value) {
res.write(value);
}
}
}
}
res.end();
} 不是很懂核心内部的代码核心,综合 ChatGPT 给的参考以及 console.log 出的结果应该是直接删除就好了(因为在HTTP/2中并不需要该值),希望 Astro 团队尽快修复,再次感谢 Astro 团队创造出如此容易上手理解的框架。 |
It's fixed in |
Astro Info
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
When https is enabled locally —— UnsupportedWarning: Status message is not supported by HTTP/2 (RFC7540 8.1.2.4)
What's the expected result?
Link to Minimal Reproducible Example
https://owainmavxv.github.stackblitz.io
Participation
The text was updated successfully, but these errors were encountered: