pwnall / node-xhr2

XMLHttpRequest emulator for node.js
MIT License
104 stars 41 forks source link

Resolve location url according to RFC #7230 #39

Open jsoo1 opened 4 years ago

jsoo1 commented 4 years ago

Relative locations are allowed when the status code is a redirect. The location url should resolve to the effective request URI: https://tools.ietf.org/html/rfc7230#section-5.5

The issue:

Request http://example.com/redirect Response { ... statusCode : 303, headers : { Location: "/redirected" ... } }

Expected: The new request url should be http://example.com/redirected

Actual: The new request url is /redirected