about summary refs log tree commit homepage
path: root/ext/unicorn_http/unicorn_http_common.rl
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2011-02-02 14:45:57 -0800
committerEric Wong <normalperson@yhbt.net>2011-02-02 14:45:57 -0800
commitd140e7b1ff44b06bc54c2b790d06e9c7325503fe (patch)
tree0985a4e7195bb8973a6d098cef3831ea63801db4 /ext/unicorn_http/unicorn_http_common.rl
parent24f8ef5f385e38954a5582fb2e8cd9d12fbf7d20 (diff)
downloadunicorn-d140e7b1ff44b06bc54c2b790d06e9c7325503fe.tar.gz
Just in case we have people that don't use DNS, we can support
folks who enter ugly IPv6 addresses...

IPv6 uses brackets around the address to avoid confusing
the colons used in the address with the colon used to denote
the TCP port number in URIs.
Diffstat (limited to 'ext/unicorn_http/unicorn_http_common.rl')
-rw-r--r--ext/unicorn_http/unicorn_http_common.rl2
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/unicorn_http/unicorn_http_common.rl b/ext/unicorn_http/unicorn_http_common.rl
index f165e3f..cf93fec 100644
--- a/ext/unicorn_http/unicorn_http_common.rl
+++ b/ext/unicorn_http/unicorn_http_common.rl
@@ -26,7 +26,7 @@
 
 # URI schemes and absolute paths
   scheme = ( "http"i ("s"i)? ) $downcase_char >mark %scheme;
-  hostname = (alnum | "-" | "." | "_")+;
+  hostname = ((alnum | "-" | "." | "_")+ | ("[" (":" | xdigit)+ "]"));
   host_with_port = (hostname (":" digit*)?) >mark %host;
   userinfo = ((unreserved | escape | ";" | ":" | "&" | "=" | "+")+ "@")*;