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

* CSP addition for web requests
* chore: Add cors to workspace proxies to allow for latency checks
This commit is contained in:
Steven Masley
2023-05-10 17:19:55 +00:00
committed by GitHub
parent d17ea84b4a
commit 3f9af6f5e7
4 changed files with 23 additions and 1 deletions
+2
View File
@@ -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 latency checking.
cspSrcs.Append(cspDirectiveConnectSrc, fmt.Sprintf("https://%[1]s http://%[1]s", extraHost))
}
}