Skip to content

Commit

Permalink
Rework Multipart error classes.
Browse files Browse the repository at this point in the history
  • Loading branch information
ioquatix committed Dec 16, 2022
1 parent e403966 commit 8caf16a
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions lib/rack/multipart/parser.rb
Expand Up @@ -3,18 +3,23 @@
require 'strscan'

require_relative '../utils'
require_relative '../bad_request'

module Rack
module Multipart
class MultipartPartLimitError < Errno::EMFILE; end
class MultipartPartLimitError < Errno::EMFILE;
end

# Use specific error class when parsing multipart request
# that ends early.
class EmptyContentError < ::EOFError; end
class EmptyContentError < ::EOFError
include BadRequest
end

# Base class for multipart exceptions that do not subclass from
# other exception classes for backwards compatibility.
class Error < StandardError; end
class Error < StandardError
end

EOL = "\r\n"
MULTIPART = %r|\Amultipart/.*boundary=\"?([^\";,]+)\"?|ni
Expand Down

0 comments on commit 8caf16a

Please sign in to comment.