Skip to content

Commit 2eb4235

Browse files
committed
Send requests with application/json content type
This is required both by JSON Wire Protocol and W3C WebDriver specification. Closes #5615 and #5659.
1 parent 5516b4f commit 2eb4235

File tree

1 file changed

+4
-1
lines changed
  • rb/lib/selenium/webdriver/remote/http

1 file changed

+4
-1
lines changed

rb/lib/selenium/webdriver/remote/http/common.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,10 @@ module Http
2222
class Common
2323
MAX_REDIRECTS = 20 # same as chromium/gecko
2424
CONTENT_TYPE = 'application/json'.freeze
25-
DEFAULT_HEADERS = {'Accept' => CONTENT_TYPE}.freeze
25+
DEFAULT_HEADERS = {
26+
'Accept' => CONTENT_TYPE,
27+
'Content-Type' => "#{CONTENT_TYPE}; charset=UTF-8"
28+
}.freeze
2629

2730
attr_accessor :timeout
2831
attr_writer :server_url

0 commit comments

Comments
 (0)