lib/site_hook/webhook.rb in site_hook-0.6.12 vs lib/site_hook/webhook.rb in site_hook-0.6.13
- old
+ new
@@ -153,14 +153,11 @@
when 0
status 200
headers 'Content-Type' => 'application/json'
body { { 'status': 'success' }.to_json }
when -1, -2, -3
- status 400
- headers 'Content-Type' => 'application/json'
- body do
- { 'status': 'exception', error: jekyll_status.fetch(:message).to_s }
- end
+ halt 400, { 'Content-Type' => 'application/json' }, { 'status': 'exception', error: jekyll_status.fetch(:message).to_s }
+
end
else
halt 403, { 'Content-Type' => 'application/json' }, { message: 'incorrect secret', 'status': 'failure' }.to_json
end