hato 0.0.9 → 0.0.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/hato/httpd.rb +2 -2
- data/lib/hato/version.rb +1 -1
- data/spec/lib/hato/httpd_spec.rb +3 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bf96ac2f3fa1d6c8de28dd9e5f4a3e6f97d24def
|
4
|
+
data.tar.gz: 60a15c63f3728bcc9099ecb086d108015901fb53
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bce2877832adb1b63563b28a2069a208afda82872d42921d40cae2e4147c9bc4e90af0b90bc7799b0b19135b2713fc139ca324d8415d1798bf1b8b5f7ca0abea
|
7
|
+
data.tar.gz: 4d687794704552bbeb694a48dfa00d1b5fb6330b0630461965fb512c336b3bc557fd3423ddc3be840d9097598f05a3e36bc45f6550f4391a6da97e89d53d6264
|
data/lib/hato/httpd.rb
CHANGED
@@ -50,14 +50,14 @@ module Hato
|
|
50
50
|
end
|
51
51
|
|
52
52
|
post '/webhook/:owner/:repository' do
|
53
|
-
event = request.env['X-
|
53
|
+
event = request.env['X-Github-Event']
|
54
54
|
owner = params[:owner]
|
55
55
|
repository = params[:repository]
|
56
56
|
|
57
57
|
if !event
|
58
58
|
halt 400, JSON.dump(
|
59
59
|
status: :error,
|
60
|
-
message: 'Missing mandatory header: `X-
|
60
|
+
message: 'Missing mandatory header: `X-Github-Event`',
|
61
61
|
)
|
62
62
|
end
|
63
63
|
|
data/lib/hato/version.rb
CHANGED
data/spec/lib/hato/httpd_spec.rb
CHANGED
@@ -67,7 +67,7 @@ describe Hato::Httpd do
|
|
67
67
|
payload: {foo: 'bar'},
|
68
68
|
api_key: 'test',
|
69
69
|
}, {
|
70
|
-
'X-
|
70
|
+
'X-Github-Event' => 'test',
|
71
71
|
}
|
72
72
|
expect(last_response).to be_ok
|
73
73
|
expect(last_response.body).to eq('{"status":"success","message":"Successfully sent the message you notified to me."}')
|
@@ -80,14 +80,14 @@ describe Hato::Httpd do
|
|
80
80
|
api_key: 'test',
|
81
81
|
}
|
82
82
|
expect(last_response).to be_bad_request
|
83
|
-
expect(last_response.body).to eq('{"status":"error","message":"Missing mandatory header: `X-
|
83
|
+
expect(last_response.body).to eq('{"status":"error","message":"Missing mandatory header: `X-Github-Event`"}')
|
84
84
|
end
|
85
85
|
|
86
86
|
it 'should be error when payload is not passed' do
|
87
87
|
post '/webhook/kentaro/hato', {
|
88
88
|
api_key: 'test',
|
89
89
|
}, {
|
90
|
-
'X-
|
90
|
+
'X-Github-Event' => 'test',
|
91
91
|
}
|
92
92
|
expect(last_response).to be_bad_request
|
93
93
|
expect(last_response.body).to eq('{"status":"error","message":"Missing mandatory parameter: `payload`"}')
|