From f272a5ae72144989f7c2a604e518e0dfa845c88f Mon Sep 17 00:00:00 2001 From: WeebDataHoarder <57538841+WeebDataHoarder@users.noreply.github.com> Date: Tue, 8 Apr 2025 02:38:53 +0200 Subject: [PATCH] Load challenge as style --- examples/forgejo.yml | 4 ++++ lib/state.go | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/examples/forgejo.yml b/examples/forgejo.yml index 975e290..f12e58a 100644 --- a/examples/forgejo.yml +++ b/examples/forgejo.yml @@ -121,6 +121,10 @@ challenges: # verifies that result = key mode: "key" probability: 0.1 + parameters: + key-code: 200 + key-mime: text/css + key-content: "" # Challenges with a redirect via Refresh header (non-JS, requires HTTP parsing and logic) self-header-refresh: diff --git a/lib/state.go b/lib/state.go index 385c55d..820163a 100644 --- a/lib/state.go +++ b/lib/state.go @@ -406,7 +406,7 @@ func NewState(p policy.Policy, settings StateSettings) (state *State, err error) redirectUri.RawQuery = values.Encode() - w.Header().Set("Link", fmt.Sprintf("<%s>; rel=preload; as=fetch; crossorigin=1", redirectUri.String())) + w.Header().Set("Link", fmt.Sprintf("<%s>; rel=preload; as=style; fetchpriority=high", redirectUri.String())) defer func() { // remove old header header! w.Header().Del("Link")