Set X-Away-Id on response
This commit is contained in:
@@ -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)
|
# 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!
|
# Works on HTTP/2 and above!
|
||||||
self-preload-link:
|
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"'
|
condition: '"Sec-Fetch-Mode" in headers && headers["Sec-Fetch-Mode"] == "navigate"'
|
||||||
mode: "preload-link"
|
mode: "preload-link"
|
||||||
runtime:
|
runtime:
|
||||||
|
@@ -457,6 +457,11 @@ func (state *State) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
r.Header.Set("X-Away-Id", hex.EncodeToString(data.Id[:]))
|
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))
|
r = r.WithContext(context.WithValue(r.Context(), "_goaway_data", &data))
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user