From b440d9c064b20138cc6f9a669b041c5955447dd6 Mon Sep 17 00:00:00 2001 From: patrik Date: Sat, 26 Apr 2014 13:34:48 +0000 Subject: [PATCH] fix redirect bug in head request where redirects would not be honored --- nselib/http.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nselib/http.lua b/nselib/http.lua index 340520f71..29959cfbe 100644 --- a/nselib/http.lua +++ b/nselib/http.lua @@ -1557,9 +1557,9 @@ function head(host, port, path, options) local response, state, location local u = { host = host, port = port, path = path } repeat - response, state = lookup_cache("HEAD", host, port, path, options); + response, state = lookup_cache("HEAD", u.host, u.port, u.path, options); if response == nil then - response = generic_request(host, port, "HEAD", path, options) + response = generic_request(u.host, u.port, "HEAD", u.path, options) insert_cache(state, response); end u = parse_redirect(host, port, path, response)