question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[feature request] disable decode_param for path routing

See original GitHub issue

I have some special urls thats get mapped to local files like image50%.png.

app.get('/open/:path(*)', (req, res) => {})

But it doesn’t work because express automaticly calls decode_param. It throws Failed to decode param.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
dougwilsoncommented, Feb 16, 2022

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, decodeURIComplement throws as invalid, then Express.js will bubble up that error. I did not make any statements regarding how Firefox works, of course, though my understanding is it will send whatever the user types in, regardless of what the web server is expecting. My guess, though, is that Firefox will still turn spaces into %20, so if you disable the param decoding, a URL like /open/foo bar.jpg will end up as foo%20bar.jpg on the server when you have decoding disabled, even if the user typed in a literal space, so turning it off probably has down sides.

0reactions
lublakcommented, Feb 17, 2022

@dougwilson for me it works fine 😃 thanks for your tip. But i decided only support some %. urlPath.replace(/%([&$%.-_ #?=*/]|$)/g, '%25$1')

Read more comments on GitHub >

github_iconTop Results From Across the Web

Feature Request: ECMP Path Monitoring - LIVEcommunity
Hi @Aewald785 ,. If you are not using static routes, you probably are using BGP with the default route only, the ISP should...
Read more >
LED Disable Feature Request - Peplink | Pepwave - Forum
Using the MAX-HD2-DOM-M- 1LTE router. It is currently mounted using the provided mounting bracket See Page 21 on the pepwave-max-user-manual. I ...
Read more >
Release notes for JBoss Community at SourceForge.net
Community driven projects featuring the latest innovations for cutting edge apps. Our flagship project JBoss AS is the leading Open Source,…
Read more >
Fastly: Route n% of traffic based on a path param
So I have to randomize the requests around my '${specialPathParams}' which actually looks like randombool with seeded param:.
Read more >
Go Fiber by Examples: Delving into built-in functions
Disable keep-alive connections. ... Note: Route paths, combined with a request method, define the endpoints at which requests can be made.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found