fix: add sticky headers to the git diff (#22425)

<!--

If you have used AI to produce some or all of this PR, please ensure you
have read our [AI Contribution
guidelines](https://coder.com/docs/about/contributing/AI_CONTRIBUTING)
before submitting.

-->
This commit is contained in:
Kyle Carberry
2026-02-27 19:03:11 -05:00
committed by GitHub
parent 2bdacae5f5
commit 256284b7fe
3 changed files with 51 additions and 7 deletions
+8
View File
@@ -90,6 +90,14 @@ export default defineConfig({
target: process.env.CODER_HOST || "http://localhost:3000",
secure: process.env.NODE_ENV === "production",
configure: (proxy) => {
if (process.env.CODER_SESSION_TOKEN) {
proxy.on("proxyReq", (proxyReq) => {
proxyReq.setHeader(
"Coder-Session-Token",
process.env.CODER_SESSION_TOKEN!,
);
});
}
// Vite does not catch socket errors, and stops the webserver.
// As /logs endpoint can return HTTP 4xx status, we need to embrace
// Vite with a custom error handler to prevent from quitting.