Closed josephmturner closed 1 year ago
Resolves #64 .
@josephmturner @RangerMauve
Perhaps I'm being overly pedantic, but just a thought: rather than automatically adding/removing slashes to make received paths valid, would it be a good idea to return an appropriate HTTP error status code and a message like, "Invalid path: paths must begin with a / and not end with one"? Generally I advocate for Postel's Law, but in this case, insisting on "correctness" might help prevent clients from making mistakes and having bugs on their end.
@alphapapa I think in this case all paths should start with a /
if they're parsed by the URL object, I'm not 100% sure which edge cases they would be omitted in. 🤔
I'm also into throwing an error if we get a weird URL.
I'm also into throwing an error if we get a weird URL.
+1
/