Opened 5 years ago

Last modified 5 years ago

#4229 defect new

twisted.web does not handle urls over 16384

Reported by: throwawayaccountr4234 Owned by: throwawayaccountr4234
Priority: normal Milestone:
Component: web Keywords: web, url
Cc: thijs Branch:
Author: Launchpad Bug:

Description (last modified by thijs)

When a URL longer then 16K chars is requested to a twisted.web server the server drops the connection.

The reason for this is that the twisted.web server uses protocols.basic.LineReceiver for handling the request and header sections. If the LineReceiver receives a line longer than 16K it simply drops the connection.

While there should probably be max length of the url in the web server, it would be nice to have it properly configurable. Furthermore the server should reply with 414 REQUEST_URI_TOO_LONG if the url is too long.

Our temporary fix have been to raise the MAXLENGTH value in the LineReceiver.

And yes, this is a real problem :-). We query a server for several hundred different states, where interesting states are embedded in the URL.

Change History (3)

comment:1 Changed 5 years ago by thijs

  • Cc thijs added
  • Description modified (diff)

comment:2 Changed 5 years ago by khorn

see also: #3277

comment:3 Changed 5 years ago by exarkun

  • Owner changed from jknight to throwawayaccountr4234

While there should probably be max length of the url in the web server, it would be nice to have it properly configurable.

What does "properly configurable" mean? It's already an instance attribute of the protocol object. That's pretty configurable.

Furthermore the server should reply with 414 REQUEST_URI_TOO_LONG if the url is too long.

That's a good idea. Can you file a separate ticket for this, though? One thing per ticket works best. :)

Note: See TracTickets for help on using tickets.