From aba31a8e20edf9cea632e72ab5ff42c04270a271 Mon Sep 17 00:00:00 2001 From: Fijxu Date: Mon, 15 Dec 2025 04:21:55 -0300 Subject: [PATCH] Set Kemal `max_request_line_size` to 16384 for large channel continuation query parameters. (#5566) * feat: Add configurable max_request_line_size to handle long URLs This commit adds a new configuration option `max_request_line_size` that allows users to increase the HTTP request line size limit. This is particularly useful for handling very long continuation tokens that can cause 414 (URI Too Long) errors. Changes: - Add `max_request_line_size` property to Config class - Configure Kemal server to use the custom limit if specified - Document the option in config.example.yml with recommendations - Add examples in docker-compose.yml for both YAML and env var configuration The default behavior remains unchanged (8KB limit) unless explicitly configured. This provides a solution for users experiencing 414 errors without affecting existing installations. * Hardcode max_request_line_size to 16384 --------- Co-authored-by: Sunghyun Kim --- src/invidious.cr | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/invidious.cr b/src/invidious.cr index 4dd5d1dd..2edc4702 100644 --- a/src/invidious.cr +++ b/src/invidious.cr @@ -250,6 +250,8 @@ Kemal.config.app_name = "Invidious" {% end %} Kemal.run do |config| + config.server.not_nil!.max_request_line_size = 16384 + if socket_binding = CONFIG.socket_binding File.delete?(socket_binding.path) # Create a socket and set its desired permissions