Skip to content
#

es6-javascript

Here are 2,269 public repositories matching this topic...

tinyhttp
groenroos
groenroos commented Oct 28, 2021

Describe the bug

When an optional route param (i.e. /foo/:bar?) is not supplied for a particular request, the req.params object will still contain it, with a string value of "undefined".

This would mean that i.e. if (req.params.bar) would unexpectedly always be truthy, even when the param was not supplied.

To Reproduce

Simple app with optional route param bar:

Improve this page

Add a description, image, and links to the es6-javascript topic page so that developers can more easily learn about it.

Curate this topic

Add this topic to your repo

To associate your repository with the es6-javascript topic, visit your repo's landing page and select "manage topics."

Learn more