Closed duhseekoh closed 9 years ago
Thanks for the error report. Interested in implementing a fix and writing a test? The module is pretty small.
+1!
Any chance this will be merged soon?
Not without a test case.
@amr looks like you're referring to @noahgrant's commit, which indeed has a test, and, in fact, has already been merged. I believe this issue is closed now.
When a route is specified on the options, an extra / is added on the end. So the route specified is not actually matched with the request url if the request url doesn't contain a trailing / also.
var route = slashJoin(options.route, '');
The line turns a specified route like/api/endpointone
into/api/endpointone/
So when the boolean check immediately below is ran on the requested url that we want to proxy its comparing:
"/api/endpointone" === "/api/endpointone/"
which is obviously not true.A realistic and valid use case is to be able to pass in a route with no trailing slash and expect that to match with requested urls with no trailing slash.