Make status code explicit

This commit is contained in:
Râu Cao 2023-01-12 14:32:35 +08:00
parent d4a3f8dadb
commit 4c0d8283e3
Signed by: raucao
GPG Key ID: 15E65F399D084BA9

View File

@ -6,7 +6,7 @@ class WebhooksController < ApplicationController
def lndhub
begin
payload = JSON.parse(request.body.read, symbolize_names: true)
return unless payload[:type] == "incoming"
head :no_content and return unless payload[:type] == "incoming"
rescue
head :unprocessable_entity and return
end