From 8e7edd3254175022c322d9ec1c42db3b97fea4ef Mon Sep 17 00:00:00 2001 From: Stephen Cochrane Date: Thu, 11 Feb 2021 23:33:36 +0200 Subject: [PATCH] slight change --- src/main.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/main.py b/src/main.py index 31de06b..6d81c9a 100644 --- a/src/main.py +++ b/src/main.py @@ -3,6 +3,7 @@ from flask import Flask, render_template, request, jsonify from hashlib import sha256 from datetime import datetime import os +import requests # My libs domain = 'skiqqy.xyz' @@ -18,10 +19,7 @@ def getip(dom): # Checks to see that we are not being redirected to an nginx page. def not_nginx(dom): - # Yes i know i can use requests, and I know its not efficeint to pass - # calls to the shell, but this is just temporary. - nginx = os.popen('curl -s %s | head -5 | grep nginx' % dom).read() - if nginx == '': + if requests.get(dom).status_code == 200: return True return False