Skip to content

Commit

Permalink
Send requests with application/json content type
Browse files Browse the repository at this point in the history
This is required both by JSON Wire Protocol and W3C WebDriver
specification.

Closes #5615 and #5659.
  • Loading branch information
p0deje committed Mar 23, 2018
1 parent 5516b4f commit 2eb4235
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion rb/lib/selenium/webdriver/remote/http/common.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ module Http
class Common
MAX_REDIRECTS = 20 # same as chromium/gecko
CONTENT_TYPE = 'application/json'.freeze
DEFAULT_HEADERS = {'Accept' => CONTENT_TYPE}.freeze
DEFAULT_HEADERS = {
'Accept' => CONTENT_TYPE,
'Content-Type' => "#{CONTENT_TYPE}; charset=UTF-8"
}.freeze

attr_accessor :timeout
attr_writer :server_url
Expand Down

3 comments on commit 2eb4235

@JasonLunn
Copy link

Choose a reason for hiding this comment

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

Should line 49 be removed now

@p0deje
Copy link
Member Author

@p0deje p0deje commented on 2eb4235 Mar 23, 2018

Choose a reason for hiding this comment

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

@JasonLunn Good catch!

@p0deje
Copy link
Member Author

@p0deje p0deje commented on 2eb4235 Mar 23, 2018

Choose a reason for hiding this comment

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

Fixed in 6fe22c3.

Please sign in to comment.