From 1408a7d47ffb9a455f9570d884213198d757ac8e Mon Sep 17 00:00:00 2001 From: normalperson Date: Tue, 15 Jul 2008 00:44:17 +0000 Subject: http_parser: restore r996 (accept '"', '<', and '>' characters in URLs) This seems to have gotten accidentally dropped during a merge: r1020 Some broken web browsers don't properly escape ", <, and > characters in URLs, however these URLs to occasionally legitimate and sometimes show up. This patch was submitted by Eden Li here: http://rubyforge.org/pipermail/mongrel-users/2006-October/001845.html This patch was accepted by Zed Shaw here: http://rubyforge.org/pipermail/mongrel-users/2006-October/001847.html git-svn-id: svn+ssh://rubyforge.org/var/svn/mongrel/trunk@1031 19e92222-5c0b-0410-8929-a290d50e31e9 --- test/unit/test_http_parser.rb | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'test') diff --git a/test/unit/test_http_parser.rb b/test/unit/test_http_parser.rb index 889fc88..c89cd0d 100644 --- a/test/unit/test_http_parser.rb +++ b/test/unit/test_http_parser.rb @@ -55,6 +55,24 @@ class HttpParserTest < Test::Unit::TestCase # assert parser.finished? # assert !parser.error? end + + def test_parse_ie6_urls + %w(/some/random/path" + /some/random/path> + /some/random/path< + /we/love/you/ie6?q=<""> + /url?<="&>=" + /mal"formed"? + ).each do |path| + parser = HttpParser.new + req = {} + sorta_safe = %(GET #{path} HTTP/1.1\r\n\r\n) + nread = parser.execute(req, sorta_safe, 0) + assert_equal sorta_safe.length, nread + assert parser.finished? + assert !parser.error? + end + end def test_parse_error parser = HttpParser.new -- cgit v1.2.3-24-ge0c7