yari icon indicating copy to clipboard operation
yari copied to clipboard

Double slash in URL prevents demos from loading

Open pepelsbey opened this issue 9 months ago • 2 comments

Summary

It’s easy to end up with a trailing double slash when copy-pasting URL parts. And it stops demos from loading.

URL

https://developer.mozilla.org//en-US/docs/Learn/CSS/Building_blocks/Values_and_units#frame_line_height_units

Reproduction steps

  1. Go to developer.mozilla.org//…/Values_and_units
  2. Go to developer.mozilla.org/…/Values_and_units
  3. Compare rendering of the frame with demo

Expected behavior

Loaded demo

Actual behavior

Empty frame

Device

Desktop

Browser

Firefox

Browser version

Stable

Operating system

Mac OS

Screenshot

No response

Anything else?

No response

Validations

pepelsbey avatar Nov 16 '23 14:11 pepelsbey

FWIW:

% curl -I https://developer.mozilla.org//en-US/docs/Learn/CSS/Building_blocks/ 
HTTP/2 302
location: /en-US/docs/Learn/CSS/Building_blocks

% curl -I https://developer.mozilla.org//en-US/docs/Learn/CSS/Building_blocks 
HTTP/2 200

caugner avatar Nov 16 '23 16:11 caugner

The problem seems to be that our Cloud Function receives the normalized URL, so we cannot tell whether the user requested the wrong URL.

caugner avatar Nov 16 '23 16:11 caugner