Replies: 7 comments
|
Hi @lublak sorry you are having trouble. There is no need to disable the decoding for this. Your client should be sending the URL as a valid encoding of |
|
Apologies, I didn't mean to close the issue, as we could add some kind of app-level config to disabled/custom the param decoding. |
|
@dougwilson The problem is that the client is Firefox and it sends this over quite validly (not with %25) the user of course enters image50%.png and not image50%25.png. |
|
Hi @lublak by invalid, I am referring to what Express.js considers invalid. The reason you are getting the error is indeed because the URL is invalid according to Express.js, as it expects parameters to be URL-encoded and if the JavaScript function to decode URL-encoded strings, |
|
@dougwilson That's right I didn't think about that of course blank characters are then given as %20 by the browser. The same is true for other characters like "ä". app.use('/open', (req, res) => {
const path = decodeURIComplement(makeItValid(req.url));
})I will try to implement it tomorrow. Thanks for the thought :) |
|
No problem. The current behavior of decoding params won't be changed, as there can be security implications of your proposal, but it would depend on the application if they are relevant or not. But the feature request, as I see it, would allow the user (like yourself) to implement any kind of decoding routine as they see fit, which would allow you to write any type of logic that works for your particular use case 👍 |
|
@dougwilson for me it works fine :) thanks for your tip. |
Uh oh!
There was an error while loading. Please reload this page.
I have some special urls thats get mapped to local files like image50%.png.
But it doesn't work because express automaticly calls decode_param.
It throws
Failed to decode param.All reactions