From 64e9aa62dc6fff1e5a6176bbfc7d318bc5b2664a Mon Sep 17 00:00:00 2001 From: girst Date: Fri, 24 Jul 2020 14:28:45 +0200 Subject: [PATCH] requests_cache breaks videoproxy streaming responses are fetched in full (and would fill up the cache) see https://requests-cache.readthedocs.io/en/latest/user_guide.html --- app/proxy/__init__.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/proxy/__init__.py b/app/proxy/__init__.py index 25f62cd..f7a028e 100644 --- a/app/proxy/__init__.py +++ b/app/proxy/__init__.py @@ -1,4 +1,4 @@ -import requests +import requests, requests_cache from flask import Flask, Blueprint, request, Response from flask_login import current_user @@ -23,7 +23,8 @@ def videoplayback(): k:v for k,v in request.headers if k.lower() in REQUEST_HEADERS_WHITELIST } - r = requests.get(f"https://{host}/videoplayback", request.args.to_dict(), headers=req_headers, stream=True) + with requests_cache.disabled(): + r = requests.get(f"https://{host}/videoplayback", request.args.to_dict(), headers=req_headers, stream=True) resp_headers = { k:v for k,v in r.headers.items() -- 2.39.3