Skip to content

Change default max_frame_size#22

Open
dlindenkreuz wants to merge 1 commit intophoenixframework:mainfrom
dlindenkreuz:add-default-max-frame-size
Open

Change default max_frame_size#22
dlindenkreuz wants to merge 1 commit intophoenixframework:mainfrom
dlindenkreuz:add-default-max-frame-size

Conversation

@dlindenkreuz
Copy link

Currently, WebSockAdapter applies a default documented limit of :infinity on incoming WebSocket frame size. This leaves default setups unprotected against malicious oversized payloads unless they explicitly configure max_binary_size on the socket transport.

(More specifically, the default value is not specified and is left to the underlying web servers like Bandit)

This is inconsistent with the long polling transport for Phoenix Channels, where incoming event messages are limited to 10MB (currently hardcoded).

This PR changes the default max_frame_size to 10MB to match the limit already in place for long polling. Applications that need to support larger frames can opt out by raising or removing the limit explicitly.

Strictly speaking, this would be a breaking change, but then again, web socket frames >10MB are not that common. WDYT?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant