aboutsummaryrefslogtreecommitdiff
path: root/registry/registry.go
diff options
context:
space:
mode:
authorJulio Capote <jcapote@gmail.com>2023-01-06 16:35:49 +0000
committerJulio Capote <jcapote@gmail.com>2023-01-06 16:35:49 +0000
commit80bbd953ae9e2a9bf901b5804254d31617104d46 (patch)
treedbc11c8080e0998e8547f23a778240636bfb4440 /registry/registry.go
parentfad3c00740aa081b372468a897834b85756158bb (diff)
downloadcommunique-80bbd953ae9e2a9bf901b5804254d31617104d46.tar.gz
use struct encoding
Diffstat (limited to 'registry/registry.go')
-rw-r--r--registry/registry.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/registry/registry.go b/registry/registry.go
index a6cd41d..d22ac9a 100644
--- a/registry/registry.go
+++ b/registry/registry.go
@@ -268,7 +268,7 @@ func (r *Registry) deliverAcceptToInbox(url, actorUrl, actorKeyUrl *url.URL, fol
h := sha256.New()
h.Write(jsonData)
- digestHeader := base64.StdEncoding.EncodeToString(h.Sum(nil))
+ digestHeader := base64.StdEncoding.Strict().EncodeToString(h.Sum(nil))
request.Header.Add("Digest", "SHA-256="+digestHeader)
request.Header.Add("Content-Type", "application/activity+json")
@@ -311,8 +311,8 @@ func (r *Registry) deliverAcceptToInbox(url, actorUrl, actorKeyUrl *url.URL, fol
}
r.mu.Unlock()
- b64sig := base64.StdEncoding.EncodeToString(signature)
- var header = `keyId="` + actorKeyUrl.String() + `",algorithm="hs2019",headers="(request-target) date digest host",signature="` + b64sig + `"`
+ b64sig := base64.StdEncoding.Strict().EncodeToString(signature)
+ var header = `keyId="` + actorKeyUrl.String() + `",algorithm="hs2019 ",headers="(request-target) date digest host",signature="` + b64sig + `"`
request.Header.Add("Signature", header)
//http sig signing code - broken?