mirror of
https://git.nadeko.net/Fijxu/invidious.git
synced 2026-01-29 18:22:27 +00:00
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.
This commit is contained in:
@@ -252,6 +252,11 @@ Kemal.config.app_name = "Invidious"
|
||||
{% end %}
|
||||
|
||||
Kemal.run do |config|
|
||||
# Set max request line size if configured
|
||||
if max_size = CONFIG.max_request_line_size
|
||||
config.server.not_nil!.max_request_line_size = max_size
|
||||
end
|
||||
|
||||
if socket_binding = CONFIG.socket_binding
|
||||
File.delete?(socket_binding.path)
|
||||
# Create a socket and set its desired permissions
|
||||
|
||||
@@ -157,6 +157,8 @@ class Config
|
||||
property host_binding : String = "0.0.0.0"
|
||||
# Path and permissions to make Invidious listen on a UNIX socket instead of a TCP port
|
||||
property socket_binding : SocketBindingConfig? = nil
|
||||
# Maximum size of request line (in bytes), increase if you get 414 errors with long URLs
|
||||
property max_request_line_size : Int32? = nil
|
||||
# Pool size for HTTP requests to youtube.com and ytimg.com (each domain has a separate pool of `pool_size`)
|
||||
property pool_size : Int32 = 100
|
||||
# HTTP Proxy configuration
|
||||
|
||||
Reference in New Issue
Block a user