Diff

net/http/parser.lua @ 4879:45bb378a4a98

net.http.parser: Keep the Host header no host is present in the URI
author Kim Alvefur <zash@zash.se>
date Tue, 15 May 2012 14:00:57 +0200
parent 4866:d54999db3aa1
child 4910:e5ec60dfb202
line wrap: on
line diff
--- a/net/http/parser.lua	Mon May 14 18:04:32 2012 +0200
+++ b/net/http/parser.lua	Tue May 15 14:00:57 2012 +0200
@@ -93,7 +93,7 @@
 					else
 						local parsed_url = url_parse(path);
 						path = preprocess_path(parsed_url.path);
-						headers.host = parsed_url.host;
+						headers.host = parsed_url.host or headers.host;
 
 						len = len or 0;
 						packet = {