Open Bug 1771066 Opened 3 years ago

web-server.rs does not properly decode URL-encoded/percent-encoded characters so things like permalink file paths that have characters like carets for WPTs like `^headers^` break

Categories

(Webtools :: Searchfox, defect)

defect

Tracking

(Not tracked)

People

(Reporter: asuth, Unassigned)

References

Details

Quoting :nika from earlier today in https://chat.mozilla.org/#/room/#searchfox:mozilla.org:

Found an odd issue where if you load https://searchfox.org/mozilla-central/source/dom/serviceworkers/test/fetch/hsts/register.html%5Eheaders%5E it works and can load the page, but if you copy & load the permalink it's broken and reports file not found. I'm guessing it probably has something to do with the caret characters.
e.g. https://searchfox.org/mozilla-central/rev/1c391443f770eddc7cde9e52dba5ef50cc233c06/dom/serviceworkers/test/fetch/hsts/register.html%5Eheaders%5E

The log output from an access like the above indicates that we probably were assuming "hyper" would normalize things for us, but it does not:

DBG ["mozilla-central", "rev", "1c391443f770eddc7cde9e52dba5ef50cc233c06", "dom", "serviceworkers", "test", "fetch", "hsts", "register.html%5Eheaders%5E"] mozilla-central rev

We're on a very old version of hyper right now for web-server.rs; we had a bad experience last time we tried to upgrade it (the fork model changed and our error handling can panic, which could take down the whole daemon), so we should likely fix this in the simplest way possible that does not involve bumping the hyper rev at this time. We should be able to move this kind of stuff into the pipeline server which will be using a more modern tokio stack.

Note that there's bug 1366331 about the search endpoint potentially being sad too, but that's router.py, not web-server.rs.

You need to log in before you can comment on or make changes to this bug.