mirror of
https://github.com/lxc/incus
synced 2026-08-02 05:26:46 +00:00
shared/ws: Remove CheckOrigin bypass
We've apparently always turned off this particular safety check but can't find a good reason for that as all complex Websocket operations are done outside of the browser. For browser-based interactions, the default behavior of enforcing an Origin match seems quite appropriate. Reported-by: https://7asecurity.com Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
This commit is contained in:
parent
5231e7a1be
commit
22250ad42e
@ -1,7 +1,6 @@
|
||||
package ws
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/gorilla/websocket"
|
||||
@ -9,6 +8,5 @@ import (
|
||||
|
||||
// Upgrader is a websocket upgrader which ignores the request Origin.
|
||||
var Upgrader = websocket.Upgrader{
|
||||
CheckOrigin: func(_ *http.Request) bool { return true },
|
||||
HandshakeTimeout: time.Second * 5,
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user