mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
PLT-6393: Fix Websocket CORS header check. (#6335)
This commit is contained in:
committed by
Joram Wilander
parent
010ec23af3
commit
85c2d5a478
@@ -345,7 +345,7 @@ func TestWebsocketOriginSecurity(t *testing.T) {
|
||||
}
|
||||
|
||||
// Should succeed now because matching CORS
|
||||
*utils.Cfg.ServiceSettings.AllowCorsFrom = "www.evil.com"
|
||||
*utils.Cfg.ServiceSettings.AllowCorsFrom = "http://www.evil.com"
|
||||
_, _, err = websocket.DefaultDialer.Dial(url+model.API_URL_SUFFIX_V3+"/users/websocket", http.Header{
|
||||
"Origin": []string{"http://www.evil.com"},
|
||||
})
|
||||
@@ -354,7 +354,7 @@ func TestWebsocketOriginSecurity(t *testing.T) {
|
||||
}
|
||||
|
||||
// Should fail because non-matching CORS
|
||||
*utils.Cfg.ServiceSettings.AllowCorsFrom = "www.good.com"
|
||||
*utils.Cfg.ServiceSettings.AllowCorsFrom = "http://www.good.com"
|
||||
_, _, err = websocket.DefaultDialer.Dial(url+model.API_URL_SUFFIX_V3+"/users/websocket", http.Header{
|
||||
"Origin": []string{"http://www.evil.com"},
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user