From e8650bbf16fe46a482d98c99399312abb960a1aa Mon Sep 17 00:00:00 2001 From: Diego Nehab Date: Thu, 13 Apr 2006 07:00:24 +0000 Subject: [PATCH] http.request was using old host header during redirects. --- FIX | 1 + NEW | 3 +++ doc/index.html | 2 ++ src/http.lua | 2 +- 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/FIX b/FIX index 84504f0..a688ba0 100644 --- a/FIX +++ b/FIX @@ -1,3 +1,4 @@ +http was preserving old host header during redirects fix smtp.send hang on source error add create field to FTP and SMTP and fix HTTP ugliness clean timeout argument to open functions in SMTP, HTTP and FTP diff --git a/NEW b/NEW index f6210b2..bc9ba2c 100644 --- a/NEW +++ b/NEW @@ -14,6 +14,9 @@ This is just a bug-fix/update release. * Improved: http.request is robust to evil servers that send inappropriate 100-continue messages (David Burgess); + * Fixed: http.request was using the old host header during + redirects (Florian Berger); + * Fixed: sample unix.c had fallen through the cracks during development (Matthew Percival); diff --git a/doc/index.html b/doc/index.html index d5a1f30..3c0bbce 100644 --- a/doc/index.html +++ b/doc/index.html @@ -172,6 +172,8 @@ header (William Trenker);
  • Improved: http.request is robust to evil servers that send inappropriate 100-continue messages (David Burgess); +
  • Fixed: http.request was using the old host header during +redirects (Florian Berger);
  • Fixed: sample unix.c had fallen through the cracks during development (Matthew Percival);
  • Fixed: error code was not being propagated correctly in diff --git a/src/http.lua b/src/http.lua index 6465c29..558f347 100644 --- a/src/http.lua +++ b/src/http.lua @@ -261,7 +261,7 @@ function tredirect(reqt, location) local result, code, headers, status = trequest { -- the RFC says the redirect URL has to be absolute, but some -- servers do not respect that - url = url.absolute(reqt, location), + url = url.absolute(reqt.url, location), source = reqt.source, sink = reqt.sink, headers = reqt.headers,