replace the old useless HOST_URL by env.request.headers["Host"]

This commit is contained in:
Fijxu
2025-01-01 01:00:41 -03:00
parent 30c0b5059d
commit 3bb7924181
5 changed files with 15 additions and 13 deletions

View File

@@ -224,7 +224,7 @@ module Invidious::Routes::API::Manifest
if !proxy.empty?
"#{proxy}/videoplayback?#{raw_params}"
else
"#{HOST_URL}/videoplayback?#{raw_params}"
"#{env.request.headers["Host"]}/videoplayback?#{raw_params}"
end
end
end
@@ -248,7 +248,7 @@ module Invidious::Routes::API::Manifest
manifest = response.body
if local
manifest = manifest.gsub("https://www.youtube.com", HOST_URL)
manifest = manifest.gsub("https://www.youtube.com", env.request.headers["Host"])
manifest = manifest.gsub("index.m3u8", "index.m3u8?local=true")
end

View File

@@ -226,7 +226,7 @@ module Invidious::Routes::API::V1::Authenticated
end
playlist = create_playlist(title, privacy, user)
env.response.headers["Location"] = "#{HOST_URL}/api/v1/auth/playlists/#{playlist.id}"
env.response.headers["Location"] = "#{env.request.headers["Host"]}/api/v1/auth/playlists/#{playlist.id}"
env.response.status_code = 201
{
"title" => title,