Skip to content
This repository was archived by the owner on Mar 22, 2026. It is now read-only.

Handle base URLs without trailing slash#52

Merged
lpil merged 2 commits intogleam-lang:mainfrom
fruno-bulax:no-trailing-slash
Dec 1, 2025
Merged

Handle base URLs without trailing slash#52
lpil merged 2 commits intogleam-lang:mainfrom
fruno-bulax:no-trailing-slash

Conversation

@fruno-bulax
Copy link
Contributor

@fruno-bulax fruno-bulax commented Nov 30, 2025

While implementing hex mirrors for gleam, I couldn't figure out why https://hexpm.upyun.com worked but https://cdn.jsdelivr.net/hex did not.

Turns out if the base URL has a non-empty path without a trailing slash, requests aren't constructed quite right.

Copy link
Member

@lpil lpil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!!

Could have have a unit test for this function for this case? 🙏

@fruno-bulax
Copy link
Contributor Author

Added a lil' test.

Copy link
Member

@lpil lpil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@lpil lpil merged commit f384134 into gleam-lang:main Dec 1, 2025
4 checks passed
@fruno-bulax fruno-bulax deleted the no-trailing-slash branch December 1, 2025 18:56
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants