diff options
| author | Omar Roth <omarroth@protonmail.com> | 2019-10-10 23:45:46 -0400 |
|---|---|---|
| committer | Omar Roth <omarroth@protonmail.com> | 2019-10-10 23:45:46 -0400 |
| commit | 7aada3f328f6e62fc0a460576509c865af3cce30 (patch) | |
| tree | e597136cf1beb50938805dca4a9a1c4a870b668f | |
| parent | dad885c051e7ea7fa0734dac01bf4bdaf8429c07 (diff) | |
| download | invidious-7aada3f328f6e62fc0a460576509c865af3cce30.tar.gz invidious-7aada3f328f6e62fc0a460576509c865af3cce30.tar.bz2 invidious-7aada3f328f6e62fc0a460576509c865af3cce30.zip | |
Avoid override for X-Client headers
| -rw-r--r-- | src/invidious/helpers/proxy.cr | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/invidious/helpers/proxy.cr b/src/invidious/helpers/proxy.cr index 388d6827..0ba3c1fe 100644 --- a/src/invidious/helpers/proxy.cr +++ b/src/invidious/helpers/proxy.cr @@ -89,9 +89,9 @@ class HTTPClient < HTTP::Client def exec(request) if self.host == "www.youtube.com" - request.headers["x-youtube-client-name"] = "1" - request.headers["x-youtube-client-version"] = "2.20180719" - request.headers["user-agent"] = "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36" + request.headers["x-youtube-client-name"] ||= "1" + request.headers["x-youtube-client-version"] ||= "1.20180719" + request.headers["user-agent"] ||= "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36" end super |
