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:
parent
1113c3a766
commit
cddd13ba16
1 changed files with 2 additions and 1 deletions
|
@ -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
|
||||
},
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue