mirror of
https://github.com/owncast/owncast.git
synced 2024-10-10 19:16:02 +00:00
Fix hashes for standalone video/chat (#1472)
* Fix hashes for standalone video/chat * Set Header vor embed
This commit is contained in:
parent
47848426ff
commit
d159f1fc69
@ -2,19 +2,30 @@ package controllers
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/owncast/owncast/router/middleware"
|
||||
)
|
||||
|
||||
// GetChatEmbedreadwrite gets the embed for readwrite chat.
|
||||
func GetChatEmbedreadwrite(w http.ResponseWriter, r *http.Request) {
|
||||
// Set our global HTTP headers
|
||||
middleware.SetHeaders(w)
|
||||
|
||||
http.ServeFile(w, r, "webroot/index-standalone-chat-readwrite.html")
|
||||
}
|
||||
|
||||
// GetChatEmbedreadonly gets the embed for readonly chat.
|
||||
func GetChatEmbedreadonly(w http.ResponseWriter, r *http.Request) {
|
||||
// Set our global HTTP headers
|
||||
middleware.SetHeaders(w)
|
||||
|
||||
http.ServeFile(w, r, "webroot/index-standalone-chat-readonly.html")
|
||||
}
|
||||
|
||||
// GetVideoEmbed gets the embed for video.
|
||||
func GetVideoEmbed(w http.ResponseWriter, r *http.Request) {
|
||||
// Set our global HTTP headers
|
||||
middleware.SetHeaders(w)
|
||||
|
||||
http.ServeFile(w, r, "webroot/index-video-only.html")
|
||||
}
|
||||
|
@ -21,7 +21,7 @@ func SetHeaders(w http.ResponseWriter) {
|
||||
}
|
||||
// Content security policy
|
||||
csp := []string{
|
||||
fmt.Sprintf("script-src 'self' %s 'sha256-2HPCfJIJHnY0NrRDPTOdC7AOSJIcQyNxzUuut3TsYRY=' 'sha256-qYEKg5UMg/KbbMBkyPIGsxtkfn/safeLBT08DK3592g=' 'sha256-2erOadwY1DsoNdxVjGlxldMJrFEUzr5sLDdB8lmm9m8=' 'sha256-DgrU+KwEGMFcB8B2ZdQyuxWWvTm7LeGpc+8SkxbSxGA='", unsafeEval),
|
||||
fmt.Sprintf("script-src 'self' %s 'sha256-2HPCfJIJHnY0NrRDPTOdC7AOSJIcQyNxzUuut3TsYRY=' 'sha256-PzXGlTLvNFZ7et6GkP2nD3XuSaAKQVBSYiHzU2ZKm8o=' 'sha256-/wqazZOqIpFSIrNVseblbKCXrezG73X7CMqRSTf+8zw=' 'sha256-jCj2f+ICtd8fvdb0ngc+Hkr/ZnZOMvNkikno/XR6VZs='", unsafeEval),
|
||||
"worker-src 'self' blob:", // No single quotes around blob:
|
||||
}
|
||||
w.Header().Set("Content-Security-Policy", strings.Join(csp, "; "))
|
||||
|
Loading…
x
Reference in New Issue
Block a user