about summary refs log tree commit homepage
path: root/ext/http11/http11_parser_common.rl
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 /ext/http11/http11_parser_common.rl
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 'ext/http11/http11_parser_common.rl')
-rw-r--r--ext/http11/http11_parser_common.rl5
1 files changed, 3 insertions, 2 deletions
diff --git a/ext/http11/http11_parser_common.rl b/ext/http11/http11_parser_common.rl
index 53c805f..ee970b1 100644
--- a/ext/http11/http11_parser_common.rl
+++ b/ext/http11/http11_parser_common.rl
@@ -11,11 +11,12 @@
   safe = ("$" | "-" | "_" | ".");
   extra = ("!" | "*" | "'" | "(" | ")" | ",");
   reserved = (";" | "/" | "?" | ":" | "@" | "&" | "=" | "+");
-  unsafe = (CTL | " " | "\"" | "#" | "%" | "<" | ">");
+  sorta_safe = ("\"" | "<" | ">");
+  unsafe = (CTL | " " | "#" | "%" | sorta_safe);
   national = any -- (alpha | digit | reserved | extra | safe | unsafe);
   unreserved = (alpha | digit | safe | extra | national);
   escape = ("%" xdigit xdigit);
-  uchar = (unreserved | escape);
+  uchar = (unreserved | escape | sorta_safe);
   pchar = (uchar | ":" | "@" | "&" | "=" | "+");
   tspecials = ("(" | ")" | "<" | ">" | "@" | "," | ";" | ":" | "\\" | "\"" | "/" | "[" | "]" | "?" | "=" | "{" | "}" | " " | "\t");