diff --git a/Gemfile b/Gemfile index 548db258189..cc11bfd5658 100644 --- a/Gemfile +++ b/Gemfile @@ -191,7 +191,7 @@ group :development, :test do gem 'guard-rspec' gem 'parallel_tests' gem 'pry-byebug' - gem 'rack-test', '1.1.0', require: 'rack/test' + gem 'rack-test', '2.1.0', require: 'rack/test' gem 'rack-vcr' gem 'rainbow' # Used to colorize output for rake tasks gem 'rspec-instrumentation-matcher' diff --git a/Gemfile.lock b/Gemfile.lock index 574ff5ec4ef..5025cba7368 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -731,8 +731,8 @@ GEM rack (>= 2.0.0) rack-protection (2.1.0) rack - rack-test (1.1.0) - rack (>= 1.0, < 3) + rack-test (2.1.0) + rack (>= 1.3) rack-timeout (0.6.3) rack-vcr (0.1.6) vcr (>= 2.9) @@ -1144,7 +1144,7 @@ DEPENDENCIES rack rack-attack rack-cors - rack-test (= 1.1.0) + rack-test (= 2.1.0) rack-timeout rack-vcr rails! diff --git a/modules/claims_api/app/controllers/claims_api/v1/forms/base.rb b/modules/claims_api/app/controllers/claims_api/v1/forms/base.rb index c39d667a9b2..8835f5deebb 100644 --- a/modules/claims_api/app/controllers/claims_api/v1/forms/base.rb +++ b/modules/claims_api/app/controllers/claims_api/v1/forms/base.rb @@ -52,7 +52,7 @@ def documents @documents ||= params.slice(*document_keys).values.map do |document| case document when String - decode_document(document) + document.blank? ? nil : decode_document(document) when ActionDispatch::Http::UploadedFile document.original_filename = create_unique_filename(doc: document) document diff --git a/modules/vba_documents/lib/vba_documents/multipart_parser.rb b/modules/vba_documents/lib/vba_documents/multipart_parser.rb index 431d13e75c6..9205174609b 100644 --- a/modules/vba_documents/lib/vba_documents/multipart_parser.rb +++ b/modules/vba_documents/lib/vba_documents/multipart_parser.rb @@ -87,7 +87,7 @@ def self.create_file_from_base64(infile) def self.get_partname(headers) headers.each do |header| name, _, value = header.partition(':') - if name == 'Content-Disposition' + if name.downcase == 'content-disposition' value.split(';').each do |param| k, _, v = param.strip.partition('=') return v.tr('"', '') if k == 'name' @@ -101,7 +101,7 @@ def self.get_partname(headers) def self.get_content_type(headers) headers.each do |header| name, _, value = header.partition(':') - return value.split(';')[0].strip if name == 'Content-Type' + return value.split(';')[0].strip if name.downcase == 'content-type' end raise VBADocuments::UploadError.new(code: 'DOC101', detail: 'Missing content-type header')