forked from nat/sludge
prevent status.natalieee.net from incrementing visit counter
This commit is contained in:
parent
33807314f4
commit
2661e44e78
@ -8,11 +8,11 @@ class Headers:
|
|||||||
def has(self, key: str) -> bool:
|
def has(self, key: str) -> bool:
|
||||||
return key in self.headers.keys()
|
return key in self.headers.keys()
|
||||||
|
|
||||||
def get(self, key: str) -> str | None:
|
def get(self, key: str) -> str:
|
||||||
if self.has(key):
|
if self.has(key):
|
||||||
return self.headers[key]
|
return self.headers[key]
|
||||||
|
|
||||||
return None
|
return ''
|
||||||
|
|
||||||
def add(self, key, value) -> None:
|
def add(self, key, value) -> None:
|
||||||
self.headers[key] = value
|
self.headers[key] = value
|
||||||
|
@ -52,7 +52,7 @@ routes = [
|
|||||||
lambda request, *_: Response(
|
lambda request, *_: Response(
|
||||||
ResponseCode.OK,
|
ResponseCode.OK,
|
||||||
{'Content-Type': 'text/html'},
|
{'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 form_data: (
|
||||||
(lambda time: (
|
(lambda time: (
|
||||||
|
Loading…
Reference in New Issue
Block a user