Set X-Away-Id on response

This commit is contained in:
WeebDataHoarder
2025-04-08 13:13:19 +02:00
parent 10dc2a0177
commit f80d6ebd15
2 changed files with 5 additions and 2 deletions

View File

@@ -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:

View File

@@ -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))