Skip to content

Commit

Permalink
Do not pass an explicit nil CONTENT_TYPE in the rack_test browser (#2701
Browse files Browse the repository at this point in the history
)

* Do not pass an explicit nil CONTENT_TYPE in the rack_test browser
  • Loading branch information
jeremyevans authored Oct 8, 2023
1 parent 49e3faf commit 6267ff6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/capybara/rack_test/browser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,13 @@ def submit(method, path, attributes, content_type: nil)
path = request_path if path.nil? || path.empty?
uri = build_uri(path)
uri.query = '' if method.to_s.casecmp('get').zero?
env = { 'HTTP_REFERER' => referer_url }
env['CONTENT_TYPE'] = content_type if content_type
process_and_follow_redirects(
method,
uri.to_s,
attributes,
'HTTP_REFERER' => referer_url,
'CONTENT_TYPE' => content_type
env
)
end

Expand Down

0 comments on commit 6267ff6

Please sign in to comment.