Skip to content
Snippets Groups Projects
Commit 73a9e81f authored by Will McCutchen's avatar Will McCutchen
Browse files

Allow github banner image in CSP

parent 55968280
Branches
Tags
No related merge requests found
......@@ -34,7 +34,7 @@ func (h *HTTPBin) Index(w http.ResponseWriter, r *http.Request) {
http.Error(w, "Not Found", http.StatusNotFound)
return
}
w.Header().Set("Content-Security-Policy", "default-src 'self'; style-src 'unsafe-inline'")
w.Header().Set("Content-Security-Policy", "default-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' camo.githubusercontent.com")
writeHTML(w, assets.MustAsset("index.html"), http.StatusOK)
}
......
......@@ -64,7 +64,7 @@ func TestIndex(t *testing.T) {
handler.ServeHTTP(w, r)
assertContentType(t, w, htmlContentType)
assertHeader(t, w, "Content-Security-Policy", "default-src 'self'; style-src 'unsafe-inline'")
assertHeader(t, w, "Content-Security-Policy", "default-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' camo.githubusercontent.com")
assertBodyContains(t, w, "go-httpbin")
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment