mockttp
mockttp copied to clipboard
Fix invalid url escaping - replaced url parsing from url.parse to new…
This pull requests replaces url handling in request processing.
REASON Some urls can change due to legacy parsing.
For example, parsing the following url https://example.com:8080/validate?param=\\/|+-
results in the following:
url.parse
: https://example.com:8080/validate?param=%5C/%7C+-
new URL
: https://example.com:8080/validate?param=\\/|+-
It can lead to incompatibilities with some sites.
As stated by NodeJS docs url.parse
is deprecated due to non-standard parsing and error-prone behavior. URL should be used instead.