learn-co-curriculum / rack-dynamic-routes-lab

Other
1 stars 655 forks source link

Request does not strictly accept /items/ #2

Closed WilliamBarela closed 6 years ago

WilliamBarela commented 7 years ago

Please see my repo for this lab:

https://github.com/WilliamBarela/rack-dynamic-routes-lab-v-000

It contains updated rpsec tests to ensure that requests which are not exclusively /items/ do not pass, e.g.: http://localhost:9292/iiiiitems/ http://localhost:9292/itemssss/

The above requests should 404, but right now they just go to "item not found" because "items" is matched by the current regex. By including word boundaries (/\bitems\b/) to the regex, this can be solved.

curiositypaths commented 6 years ago

Hi there,

Thank you for the suggestion and contribution!