mirror of
https://gitea.invidious.io/iv-org/invidious-copy-2022-08-14.git
synced 2024-08-15 00:53:20 +00:00
Raise 400 on invalid request to '/feed/webhook'
This commit is contained in:
parent
3c226892c6
commit
bb096a0357
1 changed files with 12 additions and 3 deletions
|
@ -2656,9 +2656,18 @@ end
|
||||||
get "/feed/webhook/:token" do |env|
|
get "/feed/webhook/:token" do |env|
|
||||||
verify_token = env.params.url["token"]
|
verify_token = env.params.url["token"]
|
||||||
|
|
||||||
mode = env.params.query["hub.mode"]
|
mode = env.params.query["hub.mode"]?
|
||||||
topic = env.params.query["hub.topic"]
|
topic = env.params.query["hub.topic"]?
|
||||||
challenge = env.params.query["hub.challenge"]
|
challenge = env.params.query["hub.challenge"]?
|
||||||
|
|
||||||
|
if !mode || !topic || !challenge
|
||||||
|
env.response.status_code = 400
|
||||||
|
next
|
||||||
|
else
|
||||||
|
mode = mode.not_nil!
|
||||||
|
topic = topic.not_nil!
|
||||||
|
challenge = challenge.not_nil!
|
||||||
|
end
|
||||||
|
|
||||||
case verify_token
|
case verify_token
|
||||||
when .starts_with? "v1"
|
when .starts_with? "v1"
|
||||||
|
|
Loading…
Reference in a new issue