问题
When performing a GET request to my rails application (with thin web server), I got the following error:
Invalid request: HTTP element QUERY_STRING is longer than the (1024 * 10) allowed length.
The application is part of a prototype for a master thesis, and the use of GET (not POST) requests is most important. Is there a way to change the query string length?
回答1:
To change the query string max length of thin you have to change its native C extension parser.
Just change this line in the file ext/thin_parser/thin.c
and regenerate the gem:
DEF_MAX_LENGTH(QUERY_STRING, (1024 * 10));
https://github.com/macournoyer/thin/blob/master/ext/thin_parser/thin.c#L71
来源:https://stackoverflow.com/questions/29720679/http-query-string-length-with-thin-web-server