Open chris-jamieson opened 5 years ago
Changes Missing Coverage | Covered Lines | Changed/Added Lines | % | ||
---|---|---|---|---|---|
lib/request-options.js | 2 | 3 | 66.67% | ||
<!-- | Total: | 2 | 3 | 66.67% | --> |
Totals | |
---|---|
Change from base Build 85: | -0.4% |
Covered Lines: | 169 |
Relevant Lines: | 183 |
When using
originalQuery: true
option, if the URL does not have a?
character, the regex/^.+\?/
causes the entire request URL to be set as thesearch
parameter. This change checks for the presence of a?
character in the string, and sets an empty string as the search parameter if not present.At present, the query logic does not account for URLs without a
?
character.For example, a request with URL
http://example.com/foo
with optionoriginalQuery: true
would be transformed tohttps://my-proxy-destination.com/bar?http://example.com/foo
, whilehttp://example.com/foo?id=4
would correctly be transformed to `https://my-proxy-destination.com/bar?id=4The correct behaviour for URLs without a query string (and therefore no
?
character) is that no query should be set to the proxy URL.