Page MenuHomePhabricator

MediaWiki REST API GET /page/{title}/bare returns unnormalized URL in html_url
Closed, ResolvedPublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

  • Go to Special:RestSandbox
  • Expand /v1/page/{title}/bare
  • Click “Try it out”
  • Enter Main_Page (or Main Page) as the title
  • Click “Execute”

Or directly load https://en.wikipedia.org/w/rest.php/v1/page/Main_Page/bare.

What happens?:
The response JSON includes the field:

"html_url": "https://en.wikipedia.org/w/rest.php/v1/page/Main%20Page/html"

This URL is not normalized and will return a redirect if requested.

What should have happened instead?:
It should return the normalized form of the URL (the one that the other URL redirects to):

"html_url": "https://en.wikipedia.org/w/rest.php/v1/page/Main_Page/html"

Event Timeline

aaron triaged this task as Low priority.Dec 17 2025, 7:47 AM
aaron moved this task from Incoming (Needs Triage) to Bugs & Chores on the MW-Interfaces-Team board.

Change #1219965 had a related patch set uploaded (by Reeti; author: Reeti):

[mediawiki/core@master] REST: Fix html_url normalization in /page/{title}/bare

https://gerrit.wikimedia.org/r/1219965

Claimed and addressed the issue; changes are submitted.

Change #1219965 merged by jenkins-bot:

[mediawiki/core@master] REST: Fix html_url normalization in /page/{title}/bare

https://gerrit.wikimedia.org/r/1219965

LucasWerkmeister assigned this task to Reeti.

Seems to be fixed now, thanks!