mirror of
https://gitea.invidious.io/iv-org/invidious-copy-2022-08-14.git
synced 2024-08-15 00:53:20 +00:00
Refactor HTTP::Client calls into make_client
This commit is contained in:
parent
ae7b5fac74
commit
b6fff53b21
4 changed files with 19 additions and 12 deletions
|
@ -45,7 +45,7 @@ ARCHIVE_URL = URI.parse("https://archive.org")
|
|||
LOGIN_URL = URI.parse("https://accounts.google.com")
|
||||
PUBSUB_URL = URI.parse("https://pubsubhubbub.appspot.com")
|
||||
REDDIT_URL = URI.parse("https://www.reddit.com")
|
||||
TEXTCAPTCHA_URL = URI.parse("http://textcaptcha.com/omarroth@protonmail.com.json")
|
||||
TEXTCAPTCHA_URL = URI.parse("http://textcaptcha.com")
|
||||
YT_URL = URI.parse("https://www.youtube.com")
|
||||
CHARS_SAFE = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"
|
||||
CURRENT_BRANCH = {{ "#{`git branch | sed -n '/\* /s///p'`.strip}" }}
|
||||
|
@ -2972,7 +2972,7 @@ get "/api/v1/annotations/:id" do |env|
|
|||
env.response.status_code = location.status_code
|
||||
end
|
||||
|
||||
response = HTTP::Client.get(URI.parse(location.headers["Location"]))
|
||||
response = make_client(URI.parse(location.headers["Location"])).get(location.headers["Location"])
|
||||
|
||||
if response.body.empty?
|
||||
env.response.status_code = 404
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue