about summary refs log tree commit homepage
path: root/test
diff options
context:
space:
mode:
authornormalperson <normalperson@19e92222-5c0b-0410-8929-a290d50e31e9>2008-07-15 00:44:17 +0000
committernormalperson <normalperson@19e92222-5c0b-0410-8929-a290d50e31e9>2008-07-15 00:44:17 +0000
commit1408a7d47ffb9a455f9570d884213198d757ac8e (patch)
tree49a819e98e25c9c46b38eecae399f9cbd092b4c1 /test
parent0d681b4cfb9d29ed0aeb80497dc5f1d82b094cf0 (diff)
downloadunicorn-1408a7d47ffb9a455f9570d884213198d757ac8e.tar.gz
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
Diffstat (limited to 'test')
-rw-r--r--test/unit/test_http_parser.rb18
1 files changed, 18 insertions, 0 deletions
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