1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-08-01 15:38:31 +00:00

Allow HTTPS twitch pages access to socket server

This commit is contained in:
Kane York 2016-02-03 22:01:47 -08:00
parent 1113c3a766
commit cddd13ba16

View file

@ -51,6 +51,7 @@ const defaultMinMemoryKB = 1024 * 24
// TwitchDotTv is the http origin for twitch.tv.
const TwitchDotTv = "http://www.twitch.tv"
const TwitchDotTvHTTPS = "https://www.twitch.tv"
// ResponseSuccess is a Reply ClientMessage with the MessageID not yet filled out.
var ResponseSuccess = ClientMessage{Command: SuccessCommand}
@ -175,7 +176,7 @@ var SocketUpgrader = websocket.Upgrader{
ReadBufferSize: 1024,
WriteBufferSize: 1024,
CheckOrigin: func(r *http.Request) bool {
return r.Header.Get("Origin") == TwitchDotTv
return r.Header.Get("Origin") == TwitchDotTv || r.Header.Get("Origin") == TwitchDotTvHTTPS
},
}