Bug 1843717 - Don't replace backslashes in the hash of the URL r=necko-reviewers...
commit6cdfe9a18a5a08f64d348ebc7bbe56ab23c22232
authorValentin Gosu <valentin.gosu@gmail.com>
Tue, 30 Jan 2024 10:51:15 +0000 (30 10:51 +0000)
committerValentin Gosu <valentin.gosu@gmail.com>
Tue, 30 Jan 2024 10:51:15 +0000 (30 10:51 +0000)
treea2f1c0d2b2bffe3fd55991a5ce95f002e1651da1
parent5266c6f856e633031726b380d2eebd4f11b6d466
Bug 1843717 - Don't replace backslashes in the hash of the URL r=necko-reviewers,kershaw

This bug seems to have existed since bug 249282
The probem was that on windows we wanted to normalize the path of the
file URLs. When doing that bug 249282 also started normalizing the
inputs of relative file URLs, such that it triggers this bug.

When normalizing the input, the normalization should have stopped at the
'#' character. This patch fixes net_NormalizeFileURL to address that.

Since file URLs are only ever parsed with nsStandardURL and this
implementation already normalizes file paths for all special schemes
(file, http, https, etc) calling net_NormalizeFileURL before creating
a file URL is no longer needed, so we can remove the call in
NS_NewURI entirely.

Differential Revision: https://phabricator.services.mozilla.com/D199721
netwerk/base/nsNetUtil.cpp
netwerk/base/nsURLHelper.cpp
netwerk/test/unit/test_URIs.js