From af1a26a68f9c912616eeb56bc8a4f52ba2210ae2 Mon Sep 17 00:00:00 2001 From: Milas Bowman Date: Mon, 19 Feb 2024 05:18:17 -0500 Subject: [feature] Add Mastodon-compatible HTTP signature fallback (#2659) On outgoing `GET` requests that are signed (e.g. authorized fetch), if the initial request fails with `401`, try again, but _without_ the query parameters included in the HTTP signature. This is primarily useful for compatibility with Mastodon; though hopefully this can be removed in the not-too-distant future, as they've started changing their behavior here. Signed-off-by: Milas Bowman --- internal/gtscontext/context.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'internal/gtscontext/context.go') diff --git a/internal/gtscontext/context.go b/internal/gtscontext/context.go index 0d5ed5340..73b82744a 100644 --- a/internal/gtscontext/context.go +++ b/internal/gtscontext/context.go @@ -136,7 +136,7 @@ func HTTPSignatureVerifier(ctx context.Context) httpsig.VerifierWithOptions { // SetHTTPSignatureVerifier stores the given http signature verifier and returns the // wrapped context. See HTTPSignatureVerifier() for further information on the verifier value. -func SetHTTPSignatureVerifier(ctx context.Context, verifier httpsig.Verifier) context.Context { +func SetHTTPSignatureVerifier(ctx context.Context, verifier httpsig.VerifierWithOptions) context.Context { return context.WithValue(ctx, httpSigVerifierKey, verifier) } -- cgit v1.2.3