-
-
Notifications
You must be signed in to change notification settings - Fork 2k
feat: Add configurable max_request_line_size to handle 414 errors #5394
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
feat: Add configurable max_request_line_size to handle 414 errors #5394
Conversation
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.
| ## | ||
| ## Accepted values: integer (size in bytes) | ||
| ## Default: 8192 (8KB, Crystal's default) | ||
| ## Recommended: 16384 (16KB) if experiencing 414 errors | ||
| ## | ||
| #max_request_line_size: 16384 | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The default value should reflect the actual default value of 8192
| ## | ||
| ## Accepted values: integer (size in bytes) | ||
| ## Default: 8192 (8KB, Crystal's default) | ||
| ## Recommended: 16384 (16KB) if experiencing 414 errors |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think any default recommendations is needed here. Imo instances should decide this value according to their own requirements and needs if they decide to stray from the default 8 kilobytes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about now that Youtube started to return a even larger continuation string (#5529)? 16384 seems like is a must now. Unless we adapt Invidious channel next page button to use a POST request to go to the next page with it's continuation as a body.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm also in favor of a hardcoded value. This way we know everyone is on the same page.
|
I just tested this, 16384 works fine for long URL with a large continuation string when trying to go to the next video page of a channel. |
|
Hi y'all, Imo 16384 is a good new default. |
Summary
This PR adds a configurable
max_request_line_sizeoption to handle 414 (URI Too Long) errors that occur with very long continuation tokens in API requests.Problem
Users are experiencing 414 errors when accessing channel videos with long continuation tokens. The default HTTP request line size limit (8KB) is insufficient for some YouTube continuation tokens, which can be extremely long.
Example error:
Solution
max_request_line_sizeconfiguration option to the Config classConfiguration
Users can now configure the limit in three ways:
config.yml:docker-compose.yml:Default Behavior
Testing
Security Considerations
This change provides a flexible solution for users experiencing URL length issues without affecting existing installations.
Fixes issues related to long continuation tokens in channel video pagination.