utopia 1.3.0 → 1.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 388fe83677fc504ecff20427f5838afdb1987a62
4
- data.tar.gz: a60e58681a7329cf679ed40e0e95ae9e257553ff
3
+ metadata.gz: 5899d352ea4513b585949a124dfba139c9bd9aa5
4
+ data.tar.gz: fbd5fa65a09a3b3238bc04ea1eca9d1e56c10fe8
5
5
  SHA512:
6
- metadata.gz: 556d111b28b4b31ad303a762fb4bba67bf0789df8ca56baee29539de9d3d600561f970f6542aa455a5c743330eb0c1dde75fd24dd6c12dd89424c6193280019f
7
- data.tar.gz: fe16120edbe602d50746e735f641139e27eee266cc6f2a4a638b376fa79c321a1a89c6ec62346cefe92dccf594b6a53ad1b4cae7507b1c5a2a41bda2358b1c32
6
+ metadata.gz: deea556aa6cc2fda2e28af33e986b2b8149b1a1afb35111c3c51bbe0ed0eff1e1b3da1cae7dc14e941a7f62d39c8996c70ac56163c3dca3d5339a34cbc81fbe0
7
+ data.tar.gz: 22d7503edae10b6f21e694762a1d23c3502e7f23275839e1192ad4dd06ba5fe33ec28abd3f8ecd6261a4af94e94cfe7b6232f7af1302644898ca1e7cb146f3cb
@@ -60,8 +60,8 @@ module Utopia
60
60
 
61
61
  # To accept incoming requests with content-type JSON (e.g. POST with JSON data), consider using `Rack::PostBodyContentTypeParser`.
62
62
  module ToJSON
63
- APPLICATION_JSON = 'application/json'.freeze
64
- HEADERS = {HTTP::CONTENT_TYPE => APPLICATION_JSON}.freeze
63
+ APPLICATION_JSON = HTTP::Accept::ContentType.new('application/json', charset: 'utf-8').freeze
64
+ HEADERS = {HTTP::CONTENT_TYPE => APPLICATION_JSON.to_s}.freeze
65
65
 
66
66
  def self.content_type
67
67
  APPLICATION_JSON
@@ -19,5 +19,5 @@
19
19
  # THE SOFTWARE.
20
20
 
21
21
  module Utopia
22
- VERSION = "1.3.0"
22
+ VERSION = "1.3.1"
23
23
  end
@@ -100,7 +100,7 @@ module Utopia::Controller::RespondSpec
100
100
  get '/errors/file-not-found', nil, {'HTTP_ACCEPT' => "application/json"}
101
101
 
102
102
  expect(last_response.status).to be == 404
103
- expect(last_response.headers['Content-Type']).to be == 'application/json'
103
+ expect(last_response.headers['Content-Type']).to be == 'application/json; charset=utf-8'
104
104
  expect(last_response.body).to be == '{"message":"File not found"}'
105
105
  end
106
106
 
@@ -108,7 +108,7 @@ module Utopia::Controller::RespondSpec
108
108
  get '/api/fetch', nil, {'HTTP_ACCEPT' => "application/json;version=1"}
109
109
 
110
110
  expect(last_response.status).to be == 200
111
- expect(last_response.headers['Content-Type']).to be == 'application/json'
111
+ expect(last_response.headers['Content-Type']).to be == 'application/json; charset=utf-8'
112
112
  expect(last_response.body).to be == '{"message":"Hello World"}'
113
113
  end
114
114
 
@@ -116,7 +116,7 @@ module Utopia::Controller::RespondSpec
116
116
  get '/api/fetch', nil, {'HTTP_ACCEPT' => "application/json;version=2"}
117
117
 
118
118
  expect(last_response.status).to be == 200
119
- expect(last_response.headers['Content-Type']).to be == 'application/json'
119
+ expect(last_response.headers['Content-Type']).to be == 'application/json; charset=utf-8'
120
120
  expect(last_response.body).to be == '{"message":"Goodbye World"}'
121
121
  end
122
122
  end
data/utopia.gemspec CHANGED
@@ -30,7 +30,7 @@ Gem::Specification.new do |spec|
30
30
  spec.add_dependency 'rack', '~> 1.6'
31
31
  spec.add_dependency 'rack-cache', '~> 1.2.0'
32
32
 
33
- spec.add_dependency 'http-accept', '~> 1.1.3'
33
+ spec.add_dependency 'http-accept', '~> 1.2.0'
34
34
 
35
35
  spec.add_dependency 'mail', '~> 2.6.3'
36
36
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: utopia
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
@@ -72,14 +72,14 @@ dependencies:
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: 1.1.3
75
+ version: 1.2.0
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: 1.1.3
82
+ version: 1.2.0
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: mail
85
85
  requirement: !ruby/object:Gem::Requirement