Skip to content
This repository has been archived by the owner on Apr 30, 2021. It is now read-only.

max_message_size and HTTP headers #49

Open
GroupCamp opened this issue Aug 29, 2017 · 4 comments
Open

max_message_size and HTTP headers #49

GroupCamp opened this issue Aug 29, 2017 · 4 comments

Comments

@GroupCamp
Copy link

In P:W:Message the max_message_size is set to 2048 bytes. When one have a large HTTP header sent during the handshake (lets say, a lot of cookies, or cookies with large values, or anything similar), the message is silently rejected, and it is really uneasy to:

  • detect something happened
  • change the default value

We use P:W via Net::Async::WekSocket::* to manage a WebSocket server, and there is no easy way to carry a different "max_message_size" through the whole system to the P:W:Handshake (despite the fact a large HTTP header is legitimate).

The max_message_size is not even a security : the large message has already been read when the size is tested.

@vti
Copy link
Owner

vti commented Aug 29, 2017

So what do you propose?

AFAIR if you pass max_message_size => undef it will be disabled.

@GroupCamp
Copy link
Author

In P:W:Message : $self->{max_message_size} ||= 2048;
In the Net::Async::WebSocket internal, I can change the call to P:W:Handshake::Server to :
my $hs = Protocol::WebSocket::Handshake::Server->new(
req => Protocol::WebSocket::Request->new(max_message_size => 8192)
);
It changes from the default 2048, but 'undef' will not disable the feature...

@GroupCamp
Copy link
Author

Maybe having the default value, in an 'our' global in P:W:Message, or in P:W:Handshake::Server (to be used for the Request if provided) would be a good idea : it can be changed globally, with no need to patch Net::Async stuff...

@vti
Copy link
Owner

vti commented Aug 29, 2017

Can you do a Pull Request?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants