about summary refs log tree commit homepage
path: root/test/test_http11.rb
diff options
context:
space:
mode:
authornormalperson <normalperson@19e92222-5c0b-0410-8929-a290d50e31e9>2008-03-27 21:46:28 +0000
committernormalperson <normalperson@19e92222-5c0b-0410-8929-a290d50e31e9>2008-03-27 21:46:28 +0000
commit067bd0a63f4f415c68ffc4e1857e4bac1792f309 (patch)
tree03afcb9112de645f282e7da28d2a0869f1c65562 /test/test_http11.rb
parentdbe1cf337512b8c66eacf6b0c71d075e965a727a (diff)
downloadunicorn-067bd0a63f4f415c68ffc4e1857e4bac1792f309.tar.gz
http11_parser: accept '"' (double-quote), '<', and '>' characters in URLs
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@996 19e92222-5c0b-0410-8929-a290d50e31e9
Diffstat (limited to 'test/test_http11.rb')
-rw-r--r--test/test_http11.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/test_http11.rb b/test/test_http11.rb
index 96b6a1b..64fe19b 100644
--- a/test/test_http11.rb
+++ b/test/test_http11.rb
@@ -52,6 +52,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