Skip to content

Resolve percent-encoded Unicode topic URLs - #810

Merged
thomiceli merged 1 commit into
thomiceli:masterfrom
justadityaraj:fix/807-decode-topic-path
Oct 3, 2026
Merged

thomiceli merged 1 commit into
thomiceli:masterfrom
justadityaraj:fix/807-decode-topic-path

Conversation

@justadityaraj

Copy link
Copy Markdown
Contributor

Context

Lowercase percent-encoded Unicode topic URLs are exposed by Echo as encoded route parameters. The encoded text is then used for the page heading and database filters, so the topic appears as %e6... and matching gists are not returned.

Fixes #807

Changes

  • Decode the topic route parameter once before rendering and querying.
  • Add an HTTP regression test for a lowercase percent-encoded Chinese topic.

User impact

Percent-encoded and unescaped Unicode topic URLs now resolve to the same topic page and return the same gists.

Verification

  • Regression test fails on 5afef9a because the encoded topic returns no gist, and passes with this change.
  • OG_INDEX=none OPENGIST_TEST_DB=sqlite go test ./internal/web/handlers/gist -count=1 — passed.
  • golangci-lint run internal/web/handlers/gist/all.go internal/web/handlers/gist/gist_test.go — passed with 0 issues.
  • go mod tidy — no module changes.
  • npx vite -c public/vite.config.js build — passed with existing CSS optimization and chunk-size warnings.
  • Embedded Go build with Go 1.26.6 — passed.
  • scripts/check-translations.sh — passed.
  • OPENGIST_TEST_DB=sqlite go test ./... -p 1 -count=1 — attempted; the Windows run is blocked by existing file-handle cleanup failures, unavailable symlink privileges, and host Git credential/default-branch behavior. Representative failures reproduce on the clean base.

@thomiceli
thomiceli merged commit 166c101 into thomiceli:master Oct 3, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Percent-encoded Unicode topics cannot be resolved

2 participants