From 46cb5dfa1c0782e067c4cd421328d51edf3e5eed Mon Sep 17 00:00:00 2001 From: Ryan G <78384369+SpongeManiac@users.noreply.github.com> Date: Tue, 13 Jun 2023 01:32:56 -0700 Subject: [PATCH] Update authentication.cr --- src/invidious/routes/api/v1/authentication.cr | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/invidious/routes/api/v1/authentication.cr b/src/invidious/routes/api/v1/authentication.cr index e20910f9..3e12a2ac 100644 --- a/src/invidious/routes/api/v1/authentication.cr +++ b/src/invidious/routes/api/v1/authentication.cr @@ -1,7 +1,11 @@ module Invidious::Routes::API::V1::Authentication def self.register(env) env.response.content_type = "application/json" - body_json : String = env.request.body.gets_to_end + body_io = env.request.body + body_json = "{}" + if body_io + body_json = env.request.body!.gets_to_end + end if CONFIG.registration_enabled creds = nil begin