1
0
mirror of https://git.tuxpa.in/a/code-server.git synced 2024-12-27 04:35:25 +00:00

Make websocket upgrade check case-insensitive

Fixes #925.
This commit is contained in:
Asher 2019-09-16 14:18:58 -05:00
parent 5c16399810
commit 6a864f9f47
No known key found for this signature in database
GPG Key ID: D63C1EF81242354A
2 changed files with 2 additions and 7 deletions

View File

@ -46,13 +46,8 @@ server {
RewriteRule /(.*) http://localhost:8080/$1 [P,L]
ProxyRequests off
RequestHeader set X-Forwarded-Proto https
RequestHeader set X-Forwarded-Port 443
ProxyPass / http://localhost:8080/ nocanon
ProxyPass / http://localhost:8080/ nocanon
ProxyPassReverse / http://localhost:8080/
</VirtualHost>
```

View File

@ -331,7 +331,7 @@ export abstract class Server {
this.ensureGet(request);
if (!this.authenticate(request)) {
throw new HttpError("Unauthorized", HttpCode.Unauthorized);
} else if (request.headers.upgrade !== "websocket") {
} else if (!request.headers.upgrade || request.headers.upgrade.toLowerCase() !== "websocket") {
throw new Error("HTTP/1.1 400 Bad Request");
}