pliny 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/pliny/errors.rb +1 -1
- data/lib/pliny/middleware/cors.rb +6 -6
- data/lib/pliny/middleware/versioning.rb +1 -1
- data/lib/pliny/version.rb +1 -1
- data/lib/template/Gemfile +1 -1
- metadata +9 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0737c4e1c61ecef9881625ff6bb0d2afeacc63977f239b7e2562d4aec3c3609a
|
4
|
+
data.tar.gz: f8db4293037c673ff3e33e025c75e86664f19cd207f3e36a2934e47eb981e942
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bad71b767121811048ca67857644d74d6b7e565461e96cc6f52fa3b8207a41cb6f5fa8b4d32d14fc49894709a7959c55ddd7a6c8972f1555f6d5b6108c160978
|
7
|
+
data.tar.gz: d0e2adac5319670b3c12344f6b4d40a989e74770f4ffdbffdbf7082941ed7f2590802babf478966a63c475638f4736961855a449cf9629779baf696f98f2eb28
|
data/lib/pliny/errors.rb
CHANGED
@@ -4,7 +4,7 @@ module Pliny
|
|
4
4
|
attr_accessor :id
|
5
5
|
|
6
6
|
def self.render(error)
|
7
|
-
headers = { "
|
7
|
+
headers = { "content-type" => "application/json; charset=utf-8" }
|
8
8
|
data = { id: error.id, message: error.message }
|
9
9
|
[error.status, headers, [MultiJson.encode(data)]]
|
10
10
|
end
|
@@ -44,12 +44,12 @@ module Pliny::Middleware
|
|
44
44
|
|
45
45
|
def cors_headers(env)
|
46
46
|
{
|
47
|
-
'
|
48
|
-
'
|
49
|
-
'
|
50
|
-
'
|
51
|
-
'
|
52
|
-
'
|
47
|
+
'access-control-allow-origin' => env["HTTP_ORIGIN"],
|
48
|
+
'access-control-allow-methods' => ALLOW_METHODS.join(', '),
|
49
|
+
'access-control-allow-headers' => allow_headers.join(', '),
|
50
|
+
'access-control-allow-credentials' => "true",
|
51
|
+
'access-control-max-age' => "1728000",
|
52
|
+
'access-control-expose-headers' => EXPOSE_HEADERS.join(', ')
|
53
53
|
}
|
54
54
|
end
|
55
55
|
end
|
@@ -26,7 +26,7 @@ module Pliny::Middleware
|
|
26
26
|
error = { id: :bad_version, message: <<-eos }
|
27
27
|
Please specify a version along with the MIME type. For example, `Accept: application/vnd.#{@app_name}+json; version=1`.
|
28
28
|
eos
|
29
|
-
return [400, { "
|
29
|
+
return [400, { "content-type" => "application/json; charset=utf-8" },
|
30
30
|
[MultiJson.encode(error)]]
|
31
31
|
end
|
32
32
|
|
data/lib/pliny/version.rb
CHANGED
data/lib/template/Gemfile
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pliny
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brandur Leach
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2024-02-13 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
@@ -80,7 +80,7 @@ dependencies:
|
|
80
80
|
version: '2.0'
|
81
81
|
- - "<"
|
82
82
|
- !ruby/object:Gem::Version
|
83
|
-
version: '
|
83
|
+
version: '5.0'
|
84
84
|
type: :runtime
|
85
85
|
prerelease: false
|
86
86
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -90,7 +90,7 @@ dependencies:
|
|
90
90
|
version: '2.0'
|
91
91
|
- - "<"
|
92
92
|
- !ruby/object:Gem::Version
|
93
|
-
version: '
|
93
|
+
version: '5.0'
|
94
94
|
- !ruby/object:Gem::Dependency
|
95
95
|
name: http_accept
|
96
96
|
requirement: !ruby/object:Gem::Requirement
|
@@ -171,14 +171,14 @@ dependencies:
|
|
171
171
|
requirements:
|
172
172
|
- - "~>"
|
173
173
|
- !ruby/object:Gem::Version
|
174
|
-
version:
|
174
|
+
version: '2'
|
175
175
|
type: :development
|
176
176
|
prerelease: false
|
177
177
|
version_requirements: !ruby/object:Gem::Requirement
|
178
178
|
requirements:
|
179
179
|
- - "~>"
|
180
180
|
- !ruby/object:Gem::Version
|
181
|
-
version:
|
181
|
+
version: '2'
|
182
182
|
- !ruby/object:Gem::Dependency
|
183
183
|
name: rspec
|
184
184
|
requirement: !ruby/object:Gem::Requirement
|
@@ -208,7 +208,7 @@ dependencies:
|
|
208
208
|
version: '2.0'
|
209
209
|
- - "<"
|
210
210
|
- !ruby/object:Gem::Version
|
211
|
-
version: '
|
211
|
+
version: '5.0'
|
212
212
|
type: :development
|
213
213
|
prerelease: false
|
214
214
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -218,7 +218,7 @@ dependencies:
|
|
218
218
|
version: '2.0'
|
219
219
|
- - "<"
|
220
220
|
- !ruby/object:Gem::Version
|
221
|
-
version: '
|
221
|
+
version: '5.0'
|
222
222
|
- !ruby/object:Gem::Dependency
|
223
223
|
name: timecop
|
224
224
|
requirement: !ruby/object:Gem::Requirement
|
@@ -512,7 +512,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
512
512
|
- !ruby/object:Gem::Version
|
513
513
|
version: '0'
|
514
514
|
requirements: []
|
515
|
-
rubygems_version: 3.
|
515
|
+
rubygems_version: 3.5.3
|
516
516
|
signing_key:
|
517
517
|
specification_version: 4
|
518
518
|
summary: Basic tooling to support API apps in Sinatra
|