summaryrefslogtreecommitdiffstats
path: root/utils
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2018-08-24 06:09:48 -0400
committerGeorge Goldberg <george@gberg.me>2018-08-24 11:09:48 +0100
commit9599f1a52fd4b2d029113b3ec56bd75453ae4d7b (patch)
treec00210737b590d7dea161316690bdcf86fb80399 /utils
parent5876b52ecd0b434dc8fcc0f278c3ce7dcae30d06 (diff)
downloadchat-9599f1a52fd4b2d029113b3ec56bd75453ae4d7b.tar.gz
chat-9599f1a52fd4b2d029113b3ec56bd75453ae4d7b.tar.bz2
chat-9599f1a52fd4b2d029113b3ec56bd75453ae4d7b.zip
If no origin header is set for WebSocket, do not fail upgrade (#9287)
Diffstat (limited to 'utils')
-rw-r--r--utils/api.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/utils/api.go b/utils/api.go
index d14f316b6..6e513b3ea 100644
--- a/utils/api.go
+++ b/utils/api.go
@@ -19,6 +19,10 @@ import (
func CheckOrigin(r *http.Request, allowedOrigins string) bool {
origin := r.Header.Get("Origin")
+ if origin == "" {
+ return true
+ }
+
if allowedOrigins == "*" {
return true
}