Skip to content

Commit 683d0df

Browse files
committed
Don't set content type by default
Fixes #205
1 parent ae6c43c commit 683d0df

File tree

1 file changed

+0
-9
lines changed

1 file changed

+0
-9
lines changed

lib/net/http/generic_request.rb

-9
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,6 @@ def finish
260260
def send_request_with_body(sock, ver, path, body)
261261
self.content_length = body.bytesize
262262
delete 'Transfer-Encoding'
263-
supply_default_content_type
264263
write_header sock, ver, path
265264
wait_for_continue sock, ver if sock.continue_timeout
266265
sock.write body
@@ -271,7 +270,6 @@ def send_request_with_body_stream(sock, ver, path, f)
271270
raise ArgumentError,
272271
"Content-Length not given and Transfer-Encoding is not `chunked'"
273272
end
274-
supply_default_content_type
275273
write_header sock, ver, path
276274
wait_for_continue sock, ver if sock.continue_timeout
277275
if chunked?
@@ -373,12 +371,6 @@ def flush_buffer(out, buf, chunked_p)
373371
buf.clear
374372
end
375373

376-
def supply_default_content_type
377-
return if content_type()
378-
warn 'net/http: Content-Type did not set; using application/x-www-form-urlencoded', uplevel: 1 if $VERBOSE
379-
set_content_type 'application/x-www-form-urlencoded'
380-
end
381-
382374
##
383375
# Waits up to the continue timeout for a response from the server provided
384376
# we're speaking HTTP 1.1 and are expecting a 100-continue response.
@@ -411,4 +403,3 @@ def write_header(sock, ver, path)
411403
end
412404

413405
end
414-

0 commit comments

Comments
 (0)