News for hackers. Stuff that matters.
Re:It is incorrect to "normalize" // in HTTP URL paths by dale_glass on Saturday April 18, 2026 @05:09AM (#47814409)
But maybe you should anyway.

Because maybe you use S3, which treats `foo/bar.txt` and `foo//bar.txt` as entirely separate things. Because to S3, directories don't exist and those are literally the exact names of the keys under which data is stored.

So you have script A concatenate "foo" + "/bar" and script B concatenate "foo/" + "/bar", and suddenly you have a weird problem.

I can't imagine a real use case where you'd think this is desirable.

Re:It is incorrect to "normalize" // in HTTP URL paths by Mordisquitos on Saturday April 18, 2026 @06:21AM (#47814709)
> I can't imagine a real use case where you'd think this is desirable.

Not S3, but here's a literal real use case: the entry for the Iraqw word /ameeni (woman) in Wiktionary.

https://en.wiktionary.org/wiki//ameeni

If for whatever reason your S3 keys contained English words and their translations separated by a slash, you would have a real problem if one of your scripts were to concatenate woman, / and /ameeni as woman/ameeni instead of woman//ameeni in the English/Iraqw case.

Re:It is incorrect to "normalize" // in HTTP URL paths by zarzavat on Saturday April 18, 2026 @07:35AM (#47815075)
Sounds like a Unicode problem. U+002F is not a letter codepoint and it's not appropriate to use as a letter given its history of being used for path separation. Iraqw slash should have its own code point.

Can they not just use a 3 like in Arabic?

Re:It is incorrect to "normalize" // in HTTP URL paths by kstrauser on Saturday April 18, 2026 @06:46AM (#47814835)
If you’re working with a use case where that’s even possible, you need to URL-encode it like

  woman/%2Fameeni
Consider that if the language allowed trailing slashes. What would this path mean if ameeni/ happened to be a valid word?

  ameeni//ameeni
One of those would get the slash but it’s not clear which.

W3C says:

> The slash ("/", ASCII 2F hex) character is reserved for the delimiting of substrings whose relationship is hierarchical.

Re:It is incorrect to "normalize" // in HTTP URL paths by realitylabs on Saturday April 18, 2026 @07:18AM (#47814979)
This exact issue has derailed our main document store for the past several years. We have written a couple supporting applications specifically to address the fallout from this issue.
Re:It is incorrect to "normalize" // in HTTP URL paths by secondcoming on Saturday April 18, 2026 @05:26AM (#47814481)
If a user of S3 knows that directories aren't real why would they expect directory-related normalisation to happen?
Re:It is incorrect to "normalize" // in HTTP URL paths by dale_glass on Saturday April 18, 2026 @03:57PM (#47819024)
Precisely because of it. On Linux, /bin/bash, //bin/bash and /bin//bash are the exact same file, the same inode. They look somewhat off to people, but they're entirely harmless, so cleaning that up is an aesthetic choice, not something important.

On S3 they're different. Using the wrong paths causes weird issues, like not finding things you expect you find, or storing multiple versions of the same data out of sync.

Normalizing // to / means making S3 behave more like people expect.

Re:It is incorrect to "normalize" // in HTTP URL paths by jgworks on Saturday April 18, 2026 @08:40PM (#47820819)
Another weird thing is that `foo/` is a valid object name in s3, so you can have both `foo/` and `foo` be different files.