aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulio Capote <jcapote@gmail.com>2023-01-05 00:07:30 +0000
committerJulio Capote <jcapote@gmail.com>2023-01-05 00:07:30 +0000
commit6736b04552c582ab5a07556ba20eca92612daf51 (patch)
tree04dcd1ba4ab92ca5eab70b9cbe1371c3428ddd68
parent1737b9d2cff9a8cacca647495ec9f07b07cde18b (diff)
downloadcommunique-6736b04552c582ab5a07556ba20eca92612daf51.tar.gz
fix
-rw-r--r--registry/registry.go9
1 files changed, 7 insertions, 2 deletions
diff --git a/registry/registry.go b/registry/registry.go
index d2658e5..6f47f8a 100644
--- a/registry/registry.go
+++ b/registry/registry.go
@@ -164,8 +164,13 @@ func (r *Registry) Inbox(name string, req *http.Request) error {
}
logger := r.log.With("type", "inbox")
- if req.Host != r.cfg.Domain {
- logger.Warnf("%s != %s, configured domain should match incoming Host: header otherwise HTTP signature verification will fail. You'll need to enable 'ProxyPreserveHost' (for apache2) or proxy_set_header Host $host; (for nginx)", req.Host, r.cfg.Domain)
+ domainUrl, err := url.Parse(r.cfg.Domain)
+ if err != nil {
+ return err
+ }
+
+ if req.Host != domainUrl.Host {
+ logger.Warnf("%s != %s, configured domain should match incoming Host: header otherwise things may not work right. You'll need to enable 'ProxyPreserveHost' (for apache2) or proxy_set_header Host $host; (for nginx)", req.Host, r.cfg.Domain)
}
verifier, err := httpsig.NewVerifier(req)