prevent status.natalieee.net from incrementing visit counter

This commit is contained in:
gnat 2024-10-22 03:27:53 -07:00
parent 33807314f4
commit 2661e44e78
2 changed files with 3 additions and 3 deletions

View File

@ -8,11 +8,11 @@ class Headers:
def has(self, key: str) -> bool:
return key in self.headers.keys()
def get(self, key: str) -> str | None:
def get(self, key: str) -> str:
if self.has(key):
return self.headers[key]
return None
return ''
def add(self, key, value) -> None:
self.headers[key] = value

View File

@ -52,7 +52,7 @@ routes = [
lambda request, *_: Response(
ResponseCode.OK,
{'Content-Type': 'text/html'},
(parse_file('./home.html', dict(prev='\\/')).encode('utf-8') if request.method == Method.GET else (
((parse_file('./home.html', dict(prev='\\/')).encode('utf-8') if not 'Nim httpclient' in request.headers.get('user-agent') else error_page(200)) if request.method == Method.GET else (
[
(lambda form_data: (
(lambda time: (