A vibe coded tangled fork which supports pijul.

fix: URL-decode DID path params for percent-encoded colons

ureq 3.x encodes colons in URL paths as %3A, but chi's URLParam
returns the raw (encoded) value. This caused 500 errors when
pijul-pad tried to pull from knot with encoded DID paths.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

Dzming Li 65bf0195 fbc123ab

+4 -3
+4 -3
knotserver/router.go
··· 5 5 "fmt" 6 6 "log/slog" 7 7 "net/http" 8 + "net/url" 8 9 "path/filepath" 9 10 "strings" 10 11 ··· 126 127 127 128 func (h *Knot) resolveDidRedirect(next http.Handler) http.Handler { 128 129 return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { 129 - didOrHandle := chi.URLParam(r, "did") 130 + didOrHandle, _ := url.PathUnescape(chi.URLParam(r, "did")) 130 131 if strings.HasPrefix(didOrHandle, "did:") { 131 132 next.ServeHTTP(w, r) 132 133 return ··· 162 163 // the legacy path layout (scanPath/ownerDid/name). 163 164 func (h *Knot) resolveRepo(next http.Handler) http.Handler { 164 165 return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { 165 - did := chi.URLParam(r, "did") 166 - name := chi.URLParam(r, "name") 166 + did, _ := url.PathUnescape(chi.URLParam(r, "did")) 167 + name, _ := url.PathUnescape(chi.URLParam(r, "name")) 167 168 168 169 // Try database resolution first (repo DID based path) 169 170 repoDid, err := h.db.GetRepoDid(did, name)