summaryrefslogtreecommitdiff
path: root/internal/transport/signing.go
diff options
context:
space:
mode:
authorLibravatar Milas Bowman <devnull@milas.dev>2024-02-19 05:18:17 -0500
committerLibravatar GitHub <noreply@github.com>2024-02-19 11:18:17 +0100
commitaf1a26a68f9c912616eeb56bc8a4f52ba2210ae2 (patch)
treee0dbe7799ccb3f5b611d82471e285bce641b5618 /internal/transport/signing.go
parent[chore]: Bump github.com/minio/minio-go/v7 from 7.0.66 to 7.0.67 (#2662) (diff)
downloadgotosocial-af1a26a68f9c912616eeb56bc8a4f52ba2210ae2.tar.xz
[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>
Diffstat (limited to 'internal/transport/signing.go')
-rw-r--r--internal/transport/signing.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/internal/transport/signing.go b/internal/transport/signing.go
index dcd8e206f..e33e4a05f 100644
--- a/internal/transport/signing.go
+++ b/internal/transport/signing.go
@@ -30,13 +30,13 @@ var (
)
// NewGETSigner returns a new httpsig.Signer instance initialized with GTS GET preferences.
-func NewGETSigner(expiresIn int64) (httpsig.Signer, error) {
+func NewGETSigner(expiresIn int64) (httpsig.SignerWithOptions, error) {
sig, _, err := httpsig.NewSigner(prefs, digestAlgo, getHeaders, httpsig.Signature, expiresIn)
return sig, err
}
// NewPOSTSigner returns a new httpsig.Signer instance initialized with GTS POST preferences.
-func NewPOSTSigner(expiresIn int64) (httpsig.Signer, error) {
+func NewPOSTSigner(expiresIn int64) (httpsig.SignerWithOptions, error) {
sig, _, err := httpsig.NewSigner(prefs, digestAlgo, postHeaders, httpsig.Signature, expiresIn)
return sig, err
}