mirror of
https://git.nadeko.net/Fijxu/invidious.git
synced 2025-12-17 02:18:51 +00:00
Add support for custom playlists
This commit is contained in:
@@ -129,7 +129,7 @@ class AuthHandler < Kemal::Handler
|
||||
|
||||
error_message = {"error" => ex.message}.to_json
|
||||
env.response.status_code = 403
|
||||
env.response.puts error_message
|
||||
env.response.print error_message
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -159,7 +159,8 @@ class APIHandler < Kemal::Handler
|
||||
|
||||
env.response.output.rewind
|
||||
|
||||
if env.response.headers.includes_word?("Content-Type", "application/json")
|
||||
if env.response.output.as(IO::Memory).size != 0 &&
|
||||
env.response.headers.includes_word?("Content-Type", "application/json")
|
||||
response = JSON.parse(env.response.output)
|
||||
|
||||
if fields_text = env.params.query["fields"]?
|
||||
@@ -194,7 +195,7 @@ class APIHandler < Kemal::Handler
|
||||
end
|
||||
ensure
|
||||
env.response.output = output
|
||||
env.response.puts response
|
||||
env.response.print response
|
||||
|
||||
env.response.flush
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user