-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Handle Rack errors when too many files are uploaded #2256
Merged
Merged
Changes from 7 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
4c9163e
Capture Rack's "too many multipart files" error with a spec
bschmeck c1d73f4
Create a custom error class to handle Rack's multipart error
bschmeck 45b8bad
fixup! Capture Rack's "too many multipart files" error with a spec
bschmeck 8293f10
Use our custom error class when Rack raises a multipart limit error
bschmeck b5a47cd
Use a Payload Too Large status code for TooManyMultipartFiles errors
bschmeck bc88420
Restore Rack's multipart limit after testing the failure
bschmeck dad121c
Upadate CHANGELOG
bschmeck 2cdb1b0
Reword CHANGELOG entry for MultipartPartLimitError change
bschmeck 190db46
Backticks around classname in CHANGELOG
bschmeck 2d8da41
Change next version of Grape from 1.6.3 to 1.7.0
bschmeck 46cbf07
Include the system's configured multipart file limit in the error mes…
bschmeck 7bfd055
Add a note to UPGRADING about the new TooManyMultipartFiles exception
bschmeck File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# frozen_string_literal: true | ||
|
||
module Grape | ||
module Exceptions | ||
class TooManyMultipartFiles < Base | ||
def initialize | ||
super(message: compose_message(:too_many_multipart_files), status: 413) | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Let's say "Raise
Grape::Exceptions::TooManyMultipartFiles
onMultipartPartLimitError
, when too many files are uploaded"?