Commit
·
bf6c37d
1
Parent(s):
5eae221
Update main.py
Browse files
main.py
CHANGED
|
@@ -87,7 +87,8 @@ def latlon_to_pixel(loc):
|
|
| 87 |
from urllib.parse import urlparse, parse_qs
|
| 88 |
|
| 89 |
@app.route('/proxy/<path:url>')
|
| 90 |
-
def proxy(url):
|
|
|
|
| 91 |
full_url = url
|
| 92 |
query_string = request.query_string.decode("utf-8")
|
| 93 |
if query_string:
|
|
@@ -114,7 +115,7 @@ def proxy(url):
|
|
| 114 |
logging.info(f"Sending request to: {clean_url}")
|
| 115 |
req = requests.get(clean_url, headers=headers, stream=True, timeout=3)
|
| 116 |
logging.info(f"TIME: {time.time()-start}, Status Code: {req.status_code}, Response Headers: {req.headers}")
|
| 117 |
-
return Response(req.iter_content(chunk_size=
|
| 118 |
|
| 119 |
except Exception as e:
|
| 120 |
#logging.error(f"Error in proxy: {str(e)}")
|
|
|
|
| 87 |
from urllib.parse import urlparse, parse_qs
|
| 88 |
|
| 89 |
@app.route('/proxy/<path:url>')
|
| 90 |
+
def proxy(url):
|
| 91 |
+
|
| 92 |
full_url = url
|
| 93 |
query_string = request.query_string.decode("utf-8")
|
| 94 |
if query_string:
|
|
|
|
| 115 |
logging.info(f"Sending request to: {clean_url}")
|
| 116 |
req = requests.get(clean_url, headers=headers, stream=True, timeout=3)
|
| 117 |
logging.info(f"TIME: {time.time()-start}, Status Code: {req.status_code}, Response Headers: {req.headers}")
|
| 118 |
+
return Response(req.iter_content(chunk_size=1024), content_type=req.headers['content-type'])
|
| 119 |
|
| 120 |
except Exception as e:
|
| 121 |
#logging.error(f"Error in proxy: {str(e)}")
|