from http.server import HTTPServer, BaseHTTPRequestHandler
class xxx(BaseHTTPRequestHandler):
def do_GET(self):
self.path = "/index.php"
try:
file_to_open = open(self.path).read()
self.send_response(200)
except:
file_to_open = "File cannout found!"
self.send_response(404)
self.end_headers()
self.wfile.write(bytes(file_to_open, "utf-8"))
httpd = HTTPServer(("localhost", 8080), xxx)
httpd.serve_forever()
PHP is save in HTML comments.
How can I remove extra part of string in index.php?
I would like to remove all <!--
and -->
.