mirror of
https://github.com/iv-org/invidious.git
synced 2024-12-22 16:19:53 +05:30
Fix id check
This commit is contained in:
parent
38f6d08be6
commit
a5cc66e060
@ -81,7 +81,7 @@ module Invidious::Routes::API::V1::Authenticated
|
|||||||
return error_json(409, "Watch history is disabled in preferences.")
|
return error_json(409, "Watch history is disabled in preferences.")
|
||||||
end
|
end
|
||||||
|
|
||||||
id = env.params.url["id"]?.try &.as(String)
|
id = env.params.url["id"]
|
||||||
if !id.match(/[a-zA-Z0-9_-]{11}/)
|
if !id.match(/[a-zA-Z0-9_-]{11}/)
|
||||||
return error_json(400, "Invalid video id.")
|
return error_json(400, "Invalid video id.")
|
||||||
end
|
end
|
||||||
@ -97,7 +97,7 @@ module Invidious::Routes::API::V1::Authenticated
|
|||||||
return error_json(409, "Watch history is disabled in preferences.")
|
return error_json(409, "Watch history is disabled in preferences.")
|
||||||
end
|
end
|
||||||
|
|
||||||
id = env.params.url["id"]?.try &.as(String)
|
id = env.params.url["id"]
|
||||||
if !id.match(/[a-zA-Z0-9_-]{11}/)
|
if !id.match(/[a-zA-Z0-9_-]{11}/)
|
||||||
return error_json(400, "Invalid video id.")
|
return error_json(400, "Invalid video id.")
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user