From 5c584680a4f82c11df223d120bed91755bd59a0f Mon Sep 17 00:00:00 2001 From: Jon Lundy Date: Mon, 15 Nov 2021 15:15:06 -0700 Subject: [PATCH] fix: advanced url fix --- pkg/app/wkd/app.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkg/app/wkd/app.go b/pkg/app/wkd/app.go index 0fa5795..abdc944 100644 --- a/pkg/app/wkd/app.go +++ b/pkg/app/wkd/app.go @@ -156,6 +156,11 @@ func (app *wkdApp) get(w http.ResponseWriter, r *http.Request) { log.Print(r.Host) hash := chi.URLParam(r, "hash") + if hash == "policy" { + writeText(w, 200, "") + return + } + domain := chi.URLParam(r, "domain") if domain == "" { domain = app.domain @@ -186,7 +191,7 @@ func (app *wkdApp) Routes(r *chi.Mux) { r.MethodFunc("GET", "/key/{hash}", app.get) r.MethodFunc("POST", "/pks/add", app.postKey) r.MethodFunc("GET", "/.well-known/openpgpkey/hu/{hash}", app.get) - r.MethodFunc("GET", "/.well-known/openpgpkey/hu/{domain}/{hash}", app.get) + r.MethodFunc("GET", "/.well-known/openpgpkey/{domain}/hu/{hash}", app.get) } func (app *wkdApp) createLinks(kind, name string) error {