diff --git a/sites/website.py b/sites/website.py index aeebead..da38f34 100644 --- a/sites/website.py +++ b/sites/website.py @@ -13,11 +13,18 @@ def render(data,db_object): # Render as HTML html = "" + ssl = "" + if ("localhost" in request.host or "127.0.0.1" in request.host): + ssl = "" + try: soup = BeautifulSoup(data, 'html.parser') for script in soup.find_all('script'): script.extract() + # Inject SSL + soup.append(BeautifulSoup(ssl, 'html.parser')) + html = str(soup) except Exception as e: return "
This can often be fixed by saving your site again in the editor