Closed WilliamBarela closed 6 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.
Hi there,
Thank you for the suggestion and contribution!
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.