Browse files

http: increase REQUEST_PATH maximum length to 4K

The previous REQUEST_PATH limit of 1024 is relatively small and
some users encounter problems with long URLs.  4K is a common
limit for PATH_MAX on modern GNU/Linux systems and REQUEST_PATH
is likely to translate to a filesystem path name.

Thanks to Nuo Yan <yan.nuo@gmail.com> and Lawrence Pit
<lawrence.pit@gmail.com> for their feedback on this issue.

ref: http://mid.gmane.org/CB935F19-72B8-4EC2-8A1D-5084B37C09F2@gmail.com
  • Loading branch information...
1 parent b26d3e2 commit 7eccef471a609c87281bb90d9d3b3d7a7b35709e Eric Wong committed Apr 12, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 ext/unicorn_http/global_variables.h
View
4 ext/unicorn_http/global_variables.h
@@ -62,9 +62,9 @@ NORETURN(static void parser_raise(VALUE klass, const char *));
/* Defines the maximum allowed lengths for various input elements.*/
DEF_MAX_LENGTH(FIELD_NAME, 256);
DEF_MAX_LENGTH(FIELD_VALUE, 80 * 1024);
-DEF_MAX_LENGTH(REQUEST_URI, 1024 * 12);
+DEF_MAX_LENGTH(REQUEST_URI, 1024 * 15);
DEF_MAX_LENGTH(FRAGMENT, 1024); /* Don't know if this length is specified somewhere or not */
-DEF_MAX_LENGTH(REQUEST_PATH, 1024);
+DEF_MAX_LENGTH(REQUEST_PATH, 4096); /* common PATH_MAX on modern systems */
DEF_MAX_LENGTH(QUERY_STRING, (1024 * 10));
static void init_globals(void)

0 comments on commit 7eccef4

Please sign in to comment.