Spaces:
Running
Running
Commit
·
df67509
1
Parent(s):
af3f520
Update main.py
Browse files
main.py
CHANGED
@@ -63,7 +63,7 @@ def proxy(url):
|
|
63 |
|
64 |
try:
|
65 |
logging.info(f"Sending request to: {clean_url}")
|
66 |
-
req = requests.get(clean_url, headers=headers, stream=True, timeout=
|
67 |
logging.info(f"Status Code: {req.status_code}, Response Headers: {req.headers}")
|
68 |
return Response(req.iter_content(chunk_size=2048), content_type=req.headers['content-type'])
|
69 |
|
@@ -73,7 +73,8 @@ def proxy(url):
|
|
73 |
save_exception_urls(session['exception_urls'])
|
74 |
print('Added to exceptions:',len(session['exception_urls']))
|
75 |
logging.error(f"Error in proxy.\n\n")
|
76 |
-
return
|
|
|
77 |
|
78 |
|
79 |
@app.route('/')
|
|
|
63 |
|
64 |
try:
|
65 |
logging.info(f"Sending request to: {clean_url}")
|
66 |
+
req = requests.get(clean_url, headers=headers, stream=True, timeout=7)
|
67 |
logging.info(f"Status Code: {req.status_code}, Response Headers: {req.headers}")
|
68 |
return Response(req.iter_content(chunk_size=2048), content_type=req.headers['content-type'])
|
69 |
|
|
|
73 |
save_exception_urls(session['exception_urls'])
|
74 |
print('Added to exceptions:',len(session['exception_urls']))
|
75 |
logging.error(f"Error in proxy.\n\n")
|
76 |
+
return redirect(url_for('index', new='true'))
|
77 |
+
#return send_file('static/error.png', mimetype='image/png')
|
78 |
|
79 |
|
80 |
@app.route('/')
|