You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Make request to protocol-relative url //api.dev/posts/1
Expected behavior
Polly proxies this request to api.dev and writes response.
Actual behavior
Polly strips host from //api.dev/posts/1 making it into /posts/1 and then trying to send request to http://my-app.dev/posts/1 instead of original url.
I found two places in code where url is modified. Here is one which caused desribed behavior:
- Create a shared parseUrl utility that will make sure to match the provided URL string to a url-parse instance
- Support for protocol-relative URLs (Resolves#76)
- Create a shared parseUrl utility that will make sure to match the provided URL string to a url-parse instance
- Support for protocol-relative URLs (Resolves#76)
How to reproduce:
http://my-app.dev
//api.dev/posts/1
Expected behavior
Polly proxies this request to
api.dev
and writes response.Actual behavior
Polly strips host from
//api.dev/posts/1
making it into/posts/1
and then trying to send request tohttp://my-app.dev/posts/1
instead of original url.I found two places in code where url is modified. Here is one which caused desribed behavior:
pollyjs/packages/@pollyjs/core/src/-private/request.js
Lines 53 to 60 in 73026d4
Seems like is-absolute-url check here can be swapped with custom implementation supporting protocol-relative urls
The text was updated successfully, but these errors were encountered: