From 440ed593960a5b6acedad40b681812c44c904843 Mon Sep 17 00:00:00 2001 From: dmiller Date: Wed, 17 Sep 2014 21:57:57 +0000 Subject: [PATCH] Export http.parse_redirect, a useful function --- nselib/http.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nselib/http.lua b/nselib/http.lua index c6655f32a..9d2bcefeb 100644 --- a/nselib/http.lua +++ b/nselib/http.lua @@ -1389,14 +1389,14 @@ function redirect_ok(host, port) end end --- Handles a HTTP redirect +--- Handles a HTTP redirect -- @param host table as received by the script action function -- @param port table as received by the script action function -- @param path string -- @param response table as returned by http.get or http.head -- @return url table as returned by url.parse or nil if there's no -- redirect taking place -local function parse_redirect(host, port, path, response) +function parse_redirect(host, port, path, response) if ( not(tostring(response.status):match("^30[01237]$")) or not(response.header) or not(response.header.location) ) then