Skip to content

chore: Allow cors requests to workspace proxies for latency checks #7484

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
May 10, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
CSP addition for web requests
  • Loading branch information
Emyrk committed May 10, 2023
commit 9afc8be82bc1b8367b95269d4f1fe2ffaff69ca4
2 changes: 2 additions & 0 deletions coderd/httpmw/csp.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ func CSPHeaders(websocketHosts func() []string) func(next http.Handler) http.Han
if len(extraConnect) > 0 {
for _, extraHost := range extraConnect {
cspSrcs.Append(cspDirectiveConnectSrc, fmt.Sprintf("wss://%[1]s ws://%[1]s", extraHost))
// We also require this to make http/https requests to the workspace proxy for latenecy checking.
cspSrcs.Append(cspDirectiveConnectSrc, fmt.Sprintf("https://%[1]s http://%[1]s", extraHost))
}
}

Expand Down