balazsbotond / urlcat

A URL builder library for JavaScript.
https://urlcat.org
MIT License
1.82k stars 57 forks source link

Fails if the baseUrl includes a port number #45

Closed jasonk closed 3 years ago

jasonk commented 3 years ago

Summary

I found this to be an issue:

node -e 'require( "urlcat" ).default( "http://localhost:3000/foo/:bar/baz", {} );'
Error: Missing value for path parameter 3000.

Details

I figured just ignoring path params that were entirely numeric was the simplest solution, but if somebody is actually using path params that are numbers then you might want to adjust it a bit.

balazsbotond commented 3 years ago

Nice catch! This is a rather ugly bug, I'll publish a release with your fix asap.

balazsbotond commented 3 years ago

Thank you, I've just published a patch release (v2.0.4) with this fix.

@all-contributors please add @jasonk for bug and code

allcontributors[bot] commented 3 years ago

@balazsbotond

I've put up a pull request to add @jasonk! :tada: