diff --git a/examples/forgejo.yml b/examples/forgejo.yml index 45997cc..3d0f415 100644 --- a/examples/forgejo.yml +++ b/examples/forgejo.yml @@ -116,8 +116,6 @@ challenges: # Challenges with a redirect via Link header with rel=preload and early hints (non-JS, requires HTTP parsing, fetching and logic) # Works on HTTP/2 and above! self-preload-link: - # doesn't seem to work reliably on other stuff that firefox - # userAgent.contains("Firefox/") && condition: '"Sec-Fetch-Mode" in headers && headers["Sec-Fetch-Mode"] == "navigate"' mode: "preload-link" runtime: diff --git a/lib/http.go b/lib/http.go index 44c123e..f2d4371 100644 --- a/lib/http.go +++ b/lib/http.go @@ -457,6 +457,11 @@ func (state *State) ServeHTTP(w http.ResponseWriter, r *http.Request) { } r.Header.Set("X-Away-Id", hex.EncodeToString(data.Id[:])) + w.Header().Set("X-Away-Id", hex.EncodeToString(data.Id[:])) + + // send these to client so we consistently get the headers + //w.Header().Set("Accept-CH", "Sec-CH-UA, Sec-CH-UA-Platform") + //w.Header().Set("Critical-CH", "Sec-CH-UA, Sec-CH-UA-Platform") r = r.WithContext(context.WithValue(r.Context(), "_goaway_data", &data))