2
0
Эх сурвалжийг харах

Fixed a bug in the processing of HTTP response headers

Response header values with leading or trailing whitespace were parsed incorrectly, even though the HTTP standard specifies that such whitespace should be ignored (http://www.ietf.org/rfc/rfc2616.txt - Section 4.2).
This change trims said whitespace from all HTTP reponse header values.
Antoine Gersant 11 жил өмнө
parent
commit
a49c74f89b

+ 1 - 0
std/haxe/Http.hx

@@ -602,6 +602,7 @@ class Http {
 			var a = hline.split(": ");
 			var a = hline.split(": ");
 			var hname = a.shift();
 			var hname = a.shift();
 			var hval = if( a.length == 1 ) a[0] else a.join(": ");
 			var hval = if( a.length == 1 ) a[0] else a.join(": ");
+			hval = StringTools.ltrim( StringTools.rtrim( hval ) );
 			responseHeaders.set(hname, hval);
 			responseHeaders.set(hname, hval);
 			switch(hname.toLowerCase())
 			switch(hname.toLowerCase())
 			{
 			{