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 +4 -4
- data/lib/utopia/controller/respond.rb +2 -2
- data/lib/utopia/version.rb +1 -1
- data/spec/utopia/controller/respond_spec.rb +3 -3
- data/utopia.gemspec +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5899d352ea4513b585949a124dfba139c9bd9aa5
|
4
|
+
data.tar.gz: fbd5fa65a09a3b3238bc04ea1eca9d1e56c10fe8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
data/lib/utopia/version.rb
CHANGED
@@ -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.
|
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.
|
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.
|
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.
|
82
|
+
version: 1.2.0
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: mail
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|