Skip to content

Commit

Permalink
Merge pull request #124 from mamantoha/crystal-0.30.0
Browse files Browse the repository at this point in the history
Crystal 0.30.0
  • Loading branch information
mamantoha authored Aug 2, 2019
2 parents 9f761ff + 2a24b40 commit f5100f8
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 8 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

## [...]

* **(breaking-change)** Rename `Crest::Response#successful?` to `Crest::Response#succes?`
* **(breaking-change)** Require Crystal 0.30.0`
* **(breaking-change)** Rename `Crest::Response#successful?` to `Crest::Response#success?`
* Add method `Crest::Response#status` as `HTTP::Status`

## [0.20.0][] (2019-06-14)
Expand Down
2 changes: 1 addition & 1 deletion samples/streaming.cr
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require "../crest"
require "../src/crest"
require "json"

response = Crest::Request.get("http://httpbin.org/stream/5") do |resp|
Expand Down
4 changes: 2 additions & 2 deletions shard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ authors:
description: |
Simple HTTP and REST client for Crystal, inspired by the Ruby's RestClient gem.
crystal: 0.29.0
crystal: 0.30.0

development_dependencies:
kemal:
Expand All @@ -17,6 +17,6 @@ development_dependencies:
github: mamantoha/http_proxy
version: ~> 0.3.5
ameba:
github: veelenga/ameba
github: crystal-ameba/ameba

license: MIT
4 changes: 2 additions & 2 deletions spec/integration/request_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,12 @@ describe Crest::Request do
it "do OPTIONS request" do
response = Crest::Request.execute(:options, "#{TEST_SERVER_URL}")

(response.headers["Allow"]).should eq("OPTIONS, GET")
(response.headers["allow"]).should eq("OPTIONS, GET")
end

it "call options method" do
response = Crest::Request.options("#{TEST_SERVER_URL}")

(response.headers["Allow"]).should eq("OPTIONS, GET")
(response.headers["allow"]).should eq("OPTIONS, GET")
end
end
2 changes: 1 addition & 1 deletion spec/integration/resource_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ describe Crest::Response do
resource = Crest::Resource.new(TEST_SERVER_URL)
response = resource.options

(response.headers["Allow"]).should eq("OPTIONS, GET")
(response.headers["allow"]).should eq("OPTIONS, GET")
end

it "#to_curl" do
Expand Down
2 changes: 1 addition & 1 deletion src/crest/response.cr
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ module Crest
def filename : String?
filename_regex = /filename\*?=['"]?(?:UTF-\d['"]*)?([^;\r\n"']*)['"]?;?/xi

if match_data = headers.fetch("Content-Disposition", "").as(String).match(filename_regex)
if match_data = headers.fetch("content-disposition", "").as(String).match(filename_regex)
return match_data[1]
end
end
Expand Down

0 comments on commit f5100f8

Please sign in to comment.