pechkin 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/pechkin.rb +1 -1
- data/lib/pechkin/app.rb +5 -1
- data/lib/pechkin/message_template.rb +1 -1
- data/lib/pechkin/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c55d33ae23eb9132b6f63595dd39161b0a8f32fe48fa9dc34659b591f94f9da5
|
4
|
+
data.tar.gz: 9fd2dd3bf7ea025c853c9230a5d3eb0914f1e6da8ba44c645260ac9547a9dbe4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e9053f20524428bd653c9c03df3cd8c8f2d575a79c5e73b9ebacd97f81f6a02ce6e603bd82e8674b2e72e4d6eae87a872492c67c43a637be710398ac9e122147
|
7
|
+
data.tar.gz: 51b92ecafaa72cc5baee024dd154a9dbe85a0675c98864730f7a021c2058d33cc337171e0064fb514c9f11349a5307da828d4a5cc3ecc4dddb80eded1738a357
|
data/lib/pechkin.rb
CHANGED
data/lib/pechkin/app.rb
CHANGED
@@ -70,7 +70,7 @@ module Pechkin
|
|
70
70
|
return not_found unless message?
|
71
71
|
|
72
72
|
begin
|
73
|
-
data = JSON.parse(req.body.read
|
73
|
+
data = JSON.parse(req.body.read)
|
74
74
|
rescue JSON::JSONError => e
|
75
75
|
return bad_request(e.message)
|
76
76
|
end
|
@@ -94,6 +94,10 @@ module Pechkin
|
|
94
94
|
response(404, '{"status":"error", "reason":"message not found"}')
|
95
95
|
end
|
96
96
|
|
97
|
+
def bad_request(body)
|
98
|
+
response(503, body)
|
99
|
+
end
|
100
|
+
|
97
101
|
def response(code, body)
|
98
102
|
[code.to_s, DEFAULT_HEADERS, [body]]
|
99
103
|
end
|
data/lib/pechkin/version.rb
CHANGED