jochen-schweizer / express-prom-bundle

express middleware with standard prometheus metrics in one bundle
MIT License
303 stars 67 forks source link

Option to lowercase all paths #107

Open fgblomqvist opened 1 year ago

fgblomqvist commented 1 year ago

Since URLs are case-insensitive by nature, I think it would make sense to have an option to lowercase all paths. I'm aware that this could be done by overriding the normalizePath function, but it's very conveninent to not override it and just pass an array of regexes. I also feel like this would be a very common use-case.

E.g. setting lowercasePaths to true should lowercase all paths before they're passed to the normalizePath function.

disjunction commented 1 year ago

The domain names are case insensitive, but the rest (path and query) are very much case sensitive. And normalizePath is about path, NOT domain name. Could you share any source why you think the paths are case-insensitive?

fgblomqvist commented 1 year ago

http://expressjs.com/en/api.html

Screen Shot 2022-11-09 at 15 25 25

As you can see, they're case-insensitive by default. Or am I missing something?