BraydenMoore commited on
Commit
df67509
1 Parent(s): af3f520

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +3 -2
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=5)
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 send_file('static/error.png', mimetype='image/png')
 
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('/')