2

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?

user720491
  • 589
  • 1
  • 9
  • 20
  • You'll find your answer here: http://stackoverflow.com/questions/2659952/maximum-length-of-http-get-request – cristian Apr 18 '15 at 19:03
  • I visited that and many other questions before. My problem is how to change the max length set in the thin gem. – user720491 Apr 19 '15 at 06:14

1 Answers1

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

olegueret
  • 370
  • 3
  • 9