Skip to content

Invidious is an alternative front-end to YouTube

Enforce maximum email length

Omar Rothab3980cd3857
diff --git a/src/invidious.cr b/src/invidious.cr
index c60e5537..1882c4ff 100644
--- a/src/invidious.cr
+++ b/src/invidious.cr
@@ -897,7 +897,8 @@ post "/login" do |env|
next templated "error"
end
- email = env.params.body["email"]?.try &.downcase
+ # https://stackoverflow.com/a/574698
+ email = env.params.body["email"]?.try &.downcase.byte_slice(0, 254)
password = env.params.body["password"]?
account_type = env.params.query["type"]?