generated from nathanwoodburn/python-webserver-template
fix: Set https in prod
All checks were successful
Build Docker / BuildImage (push) Successful in 30s
All checks were successful
Build Docker / BuildImage (push) Successful in 30s
This commit is contained in:
7
tools.py
7
tools.py
@@ -208,6 +208,13 @@ def proxy(url: str) -> requests.Response:
|
||||
|
||||
|
||||
def cleanProxyContent(htmlContent: str,url:str, proxyHost: str):
|
||||
# Set proxy host to https if not 127.0.0.1 or localhost
|
||||
if ":5000" not in proxyHost:
|
||||
proxyHost = proxyHost.replace("http","https")
|
||||
|
||||
|
||||
|
||||
|
||||
# Find all instances of the url in the html
|
||||
hostUrl = f"{urlparse(url).scheme}://{urlparse(url).netloc}"
|
||||
proxyUrl = f"{proxyHost}proxy/{hostUrl}"
|
||||
|
||||
Reference in New Issue
Block a user