Bug in auto_referer implementation
citreae535 opened this issue · comments
When isahc
is asked to follow redirects with auto_referer enabled, it will add a Referer
header to subsequent requests after being redirected. However, the current implementation does not remove previous Referer
headers. Therefore, the final request will have multiple Referer
headers if it is redirected more than once. This is different from curl --location --referer ";auto"
which only retains the last Referer
header. I think this is a bug and should be fixed.
Lines 83 to 87 in 2a5c175
By the way, the current implementation also does not remove the fragment and userinfo components of the URI, a MUST NOT
requirement in RFC 7231. curl
conforms to the RFC, and it would be nice if isach
does as well.
Good catch, thanks for letting me know about this! This is indeed the wrong behavior.