Skip to content

Commit

Permalink
do a sanity check on the provided ucid
Browse files Browse the repository at this point in the history
Co-Authored-By: absidue <48293849+absidue@users.noreply.github.com>
Co-Authored-By: Samantaz Fox <coding@samantaz.fr>
  • Loading branch information
3 people committed Jan 29, 2024
1 parent 9444df5 commit bee81ee
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/invidious/routes/feeds.cr
Expand Up @@ -146,7 +146,11 @@ module Invidious::Routes::Feeds
env.response.headers["Content-Type"] = "application/atom+xml"
env.response.content_type = "application/atom+xml"

ucid = env.params.url["ucid"]
if env.params.url["ucid"].matches?(/^[\w-]+$/)
ucid = env.params.url["ucid"]
else
return error_atom(400, InfoException.new("Invalid channel ucid provided."))
end

params = HTTP::Params.parse(env.params.query["params"]? || "")

Expand Down

0 comments on commit bee81ee

Please sign in to comment.