Skip to content

Conversation

@watzon
Copy link
Contributor

@watzon watzon commented Nov 8, 2025

Purpose

Add the ability for individual actions to override the global MaximumRequestSizeHandler limit using the set_request_body_limit macro. This allows actions that need to handle larger or smaller request bodies to customize their limits without affecting other actions.

Closes #1989

Checklist

  • - An issue already exists detailing the issue/or feature request that this PR fixes
  • - All specs are formatted with crystal tool format spec src
  • - Inline documentation has been added and/or updated
  • - Lucky builds on docker with ./script/setup
  • - All builds and specs pass on docker with ./script/test

Add the ability for individual actions to override the global
MaximumRequestSizeHandler limit using the `set_request_body_limit`
macro. This allows actions that need to handle larger or smaller
request bodies to customize their limits without affecting other
actions.

Includes comprehensive tests and CHANGELOG entry.
Copy link
Member

@jwoertink jwoertink left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! I think this could come in handy. I just noticed a few small things.

end
end

private def find_matching_action(context : HTTP::Server::Context)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this better @jwoertink?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, nice. Yeah, I think this works better.

@jwoertink jwoertink merged commit 44a45a4 into luckyframework:main Nov 22, 2025
7 checks passed
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.

Per-Action maximum body size limits

2 participants