This commit is contained in:
Jeroen Boersma 2025-12-15 19:13:54 +05:30 committed by GitHub
commit 591591a88f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 19 additions and 0 deletions

View file

@ -16,6 +16,24 @@ module Invidious::Routes::Companion
end
end
# /companion
def self.post_companion(env)
url = env.request.path
if env.request.query
url += "?#{env.request.query}"
end
begin
COMPANION_POOL.client do |wrapper|
wrapper.client.post(url, env.request.headers, env.request.body) do |resp|
return self.proxy_companion(env, resp)
end
end
rescue ex
end
end
def self.options_companion(env)
url = env.request.path
if env.request.query

View file

@ -227,6 +227,7 @@ module Invidious::Routing
def register_companion_routes
if CONFIG.invidious_companion.present?
get "/companion/*", Routes::Companion, :get_companion
post "/companion/*", Routes::Companion, :post_companion
options "/companion/*", Routes::Companion, :options_companion
end
end