mirror of
https://codeberg.org/git-pages/git-pages.git
synced 2026-05-14 11:11:35 +00:00
Turns out a Web Worker is a type of frame (for COEP purposes).
This commit is contained in:
@@ -12,6 +12,7 @@ import (
|
||||
"net/url"
|
||||
"os"
|
||||
"path"
|
||||
"slices"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
@@ -282,8 +283,12 @@ func getPage(w http.ResponseWriter, r *http.Request) error {
|
||||
}
|
||||
|
||||
contentType := getMediaType(entry.GetContentType())
|
||||
if contentType == "" || contentType == "text/html" || contentType == "application/xhtml+xml" {
|
||||
// allow the use of multi-threading in WebAssembly
|
||||
if slices.Contains(
|
||||
[]string{"", "text/html", "application/xhtml+xml", "text/javascript"},
|
||||
contentType,
|
||||
) {
|
||||
// allow the use of multi-threading in WebAssembly;
|
||||
// note that a Web Worker is considered a type of frame for COEP purposes
|
||||
w.Header().Set("Cross-Origin-Embedder-Policy", "credentialless")
|
||||
w.Header().Set("Cross-Origin-Opener-Policy", "same-origin")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user