Skip to content

Commit ee3baad

Browse files
dylandropAry Borenszweig
authored and
Ary Borenszweig
committedFeb 15, 2017
User-Agent should be properly capitalized in exec
1 parent f0770cd commit ee3baad

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed
 

‎src/http/client.cr

+5-5
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ class HTTP::Client
332332
#
333333
# ```
334334
# client = HTTP::Client.new("www.example.com")
335-
# response = client.{{method.id}}("/", headers: HTTP::Headers{"User-agent" => "AwesomeApp"}, body: "Hello!")
335+
# response = client.{{method.id}}("/", headers: HTTP::Headers{"User-Agent" => "AwesomeApp"}, body: "Hello!")
336336
# response.body #=> "..."
337337
# ```
338338
def {{method.id}}(path, headers : HTTP::Headers? = nil, body : BodyType = nil) : HTTP::Client::Response
@@ -344,7 +344,7 @@ class HTTP::Client
344344
#
345345
# ```
346346
# client = HTTP::Client.new("www.example.com")
347-
# client.{{method.id}}("/", headers: HTTP::Headers{"User-agent" => "AwesomeApp"}, body: "Hello!") do |response|
347+
# client.{{method.id}}("/", headers: HTTP::Headers{"User-Agent" => "AwesomeApp"}, body: "Hello!") do |response|
348348
# response.body_io.gets #=> "..."
349349
# end
350350
# ```
@@ -358,7 +358,7 @@ class HTTP::Client
358358
# The response will have its body as a `String`, accessed via `HTTP::Client::Response#body`.
359359
#
360360
# ```
361-
# response = HTTP::Client.{{method.id}}("/", headers: HTTP::Headers{"User-agent" => "AwesomeApp"}, body: "Hello!")
361+
# response = HTTP::Client.{{method.id}}("/", headers: HTTP::Headers{"User-Agent" => "AwesomeApp"}, body: "Hello!")
362362
# response.body #=> "..."
363363
# ```
364364
def self.{{method.id}}(url : String | URI, headers : HTTP::Headers? = nil, body : BodyType = nil, tls = nil) : HTTP::Client::Response
@@ -369,7 +369,7 @@ class HTTP::Client
369369
# The response will have its body as an `IO` accessed via `HTTP::Client::Response#body_io`.
370370
#
371371
# ```
372-
# HTTP::Client.{{method.id}}("/", headers: HTTP::Headers{"User-agent" => "AwesomeApp"}, body: "Hello!") do |response|
372+
# HTTP::Client.{{method.id}}("/", headers: HTTP::Headers{"User-Agent" => "AwesomeApp"}, body: "Hello!") do |response|
373373
# response.body_io.gets #=> "..."
374374
# end
375375
# ```
@@ -561,7 +561,7 @@ class HTTP::Client
561561
end
562562

563563
private def set_defaults(request)
564-
request.headers["User-agent"] ||= "Crystal"
564+
request.headers["User-Agent"] ||= "Crystal"
565565
{% if flag?(:without_zlib) %}
566566
false
567567
{% else %}

0 commit comments

Comments
 (0)
Please sign in to comment.