mirror of
https://github.com/coder/coder.git
synced 2025-07-12 00:14:10 +00:00
feat: add csp headers for embedded apps (#18374)
I modified the proxy host cache we already had and were using for websocket csp headers to also include the wildcard app host, then used those for frame-src policies. I did not add frame-ancestors, since if I understand correctly, those would go on the app, and this middleware does not come into play there. Maybe we will want to add it on workspace apps like we do with cors, if we find apps are setting it to `none` or something. Closes https://github.com/coder/internal/issues/684
This commit is contained in:
@ -965,12 +965,8 @@ func convertRegion(proxy database.WorkspaceProxy, status proxyhealth.ProxyStatus
|
||||
func convertProxy(p database.WorkspaceProxy, status proxyhealth.ProxyStatus) codersdk.WorkspaceProxy {
|
||||
now := dbtime.Now()
|
||||
if p.IsPrimary() {
|
||||
// Primary is always healthy since the primary serves the api that this
|
||||
// is returned from.
|
||||
u, _ := url.Parse(p.Url)
|
||||
status = proxyhealth.ProxyStatus{
|
||||
Proxy: p,
|
||||
ProxyHost: u.Host,
|
||||
Status: proxyhealth.Healthy,
|
||||
Report: codersdk.ProxyHealthReport{},
|
||||
CheckedAt: now,
|
||||
|
Reference in New Issue
Block a user