mirror of
https://github.com/coder/code-server.git
synced 2026-05-06 04:25:19 +02:00
Add skip-auth-preflight flag to allow OPTIONS requests through proxy (#7284)
This commit is contained in:
@@ -26,7 +26,9 @@ export async function proxy(
|
||||
): Promise<void> {
|
||||
ensureProxyEnabled(req)
|
||||
|
||||
if (!(await authenticated(req))) {
|
||||
if (req.method === "OPTIONS" && req.args["skip-auth-preflight"]) {
|
||||
// Allow preflight requests with `skip-auth-preflight` flag
|
||||
} else if (!(await authenticated(req))) {
|
||||
// If visiting the root (/:port only) redirect to the login page.
|
||||
if (!req.params.path || req.params.path === "/") {
|
||||
const to = self(req)
|
||||
|
||||
Reference in New Issue
Block a user