mirror of
https://github.com/coder/code-server.git
synced 2026-05-05 03:55:18 +02:00
Add skip-auth-preflight flag to allow OPTIONS requests through proxy (#7284)
This commit is contained in:
@@ -61,6 +61,11 @@ router.all(/.*/, async (req, res, next) => {
|
||||
|
||||
ensureProxyEnabled(req)
|
||||
|
||||
if (req.method === "OPTIONS" && req.args["skip-auth-preflight"]) {
|
||||
// Allow preflight requests with `skip-auth-preflight` flag
|
||||
return next()
|
||||
}
|
||||
|
||||
// Must be authenticated to use the proxy.
|
||||
const isAuthenticated = await authenticated(req)
|
||||
if (!isAuthenticated) {
|
||||
|
||||
Reference in New Issue
Block a user