dunglas / mercure

🪽 An open, easy, fast, reliable and battery-efficient solution for real-time communications
https://mercure.rocks
GNU Affero General Public License v3.0
3.98k stars 297 forks source link

Issue Handling Requests Larger Than 10 MB #927

Closed emil-1996 closed 3 months ago

emil-1996 commented 3 months ago

Description: When attempting to send a request larger than 10 MB to Mercure, I consistently receive an HTTP/1.1 400 Bad Request error. The request in question is targeting the URL http://mercure:8443/.well-known/mercure.

Details: The Content-Length header indicates a body size of 16,235,362 bytes. However, the bytes_read logs show only 10,485,761 bytes being processed before the request fails.

Question: How can I configure Mercure to accept request bodies larger than 10 MB?

emil-1996 commented 3 months ago

It seems this issue is related to #878.

While I understand that reducing the message size can be a workaround, I believe that the application should not, by default, limit the size of the request a user can make. Perhaps introducing a configurable flag, such as a max request size, might be a more flexible solution.

dunglas commented 3 months ago

This is a Go limitation. Currently it's not possible to bypass it.

dunglas commented 3 months ago

Closing as duplicate of #878.