Skip to content

Commit 98e5177

Browse files
committed
Update terminal.go
1 parent 57c6de6 commit 98e5177

1 file changed

Lines changed: 1 addition & 7 deletions

File tree

internal/api/handlers/terminal.go

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,7 @@ import (
1616

1717
var terminalUpgrader = websocket.Upgrader{
1818
CheckOrigin: func(r *http.Request) bool {
19-
origin := r.Header.Get("Origin")
20-
if origin == "" {
21-
return true // Allow non-browser clients (curl, etc.)
22-
}
23-
// Allow same-origin requests: the Origin host must match the request Host
24-
host := r.Host
25-
return strings.HasPrefix(origin, "http://"+host) || strings.HasPrefix(origin, "https://"+host)
19+
return true // Allow all origins (matches CORS AllowAllOrigins: true)
2620
},
2721
ReadBufferSize: 4096,
2822
WriteBufferSize: 4096,

0 commit comments

Comments
 (0)