mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-11-13 11:17:30 -06:00
[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 <devnull@milas.dev>
This commit is contained in:
parent
2db115fa36
commit
af1a26a68f
3 changed files with 16 additions and 8 deletions
|
|
@ -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)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue