Explorar el Código

fix firefoxs header websocket connection

dattk hace 10 años
padre
commit
44f8ccce89
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      Sources/HttpHandlers+WebSockets.swift

+ 1 - 1
Sources/HttpHandlers+WebSockets.swift

@@ -16,7 +16,7 @@ extension HttpHandlers {
             guard r.headers["upgrade"] == "websocket" else {
                 return .BadRequest(.Text("Invalid value of 'Upgrade' header: \(r.headers["upgrade"])"))
             }
-            guard r.headers["connection"] == "Upgrade" else {
+            guard r.headers["connection"] == "Upgrade" || r.headers["connection"] == "keep-alive, Upgrade" else {
                 return .BadRequest(.Text("Invalid value of 'Connection' header: \(r.headers["connection"])"))
             }
             guard let secWebSocketKey = r.headers["sec-websocket-key"] else {