Recently, we bumped into an issue with nock in which it won't catch a request we were sure was being mocked correctly. We were wondering for a while until .log(console.log) shed some light on what the issue was.
We noticed our host url didn't have a trailing slash (http://localhost:3000) while at the same time our mocked path didn't have a leading slash (api/bot/request.json). Turns out knock was trying to match our url with http://localhost:3000api/bot/request.json, no slash separating the host and path segments.
I was wondering if we can have nock add that slash by itself when is not present.
I can submit a PR if you guys want.
Recently, we bumped into an issue with nock in which it won't catch a request we were sure was being mocked correctly. We were wondering for a while until
.log(console.log)shed some light on what the issue was.We noticed our host url didn't have a trailing slash (
http://localhost:3000) while at the same time our mocked path didn't have a leading slash (api/bot/request.json). Turns out knock was trying to match our url withhttp://localhost:3000api/bot/request.json, no slash separating the host and path segments.I was wondering if we can have nock add that slash by itself when is not present.
I can submit a PR if you guys want.