mirror of https://gitlab.com/bashrc2/epicyon
Make post user agent checking subject to busy flag
parent
4ddabb896a
commit
013fb6cffd
13
daemon.py
13
daemon.py
|
@ -17420,12 +17420,6 @@ class PubServer(BaseHTTPRequestHandler):
|
|||
self._400()
|
||||
return
|
||||
|
||||
uaStr = self._getUserAgent()
|
||||
|
||||
if self._blockedUserAgent(callingDomain, uaStr):
|
||||
self._400()
|
||||
return
|
||||
|
||||
currTimePOST = int(time.time() * 1000)
|
||||
if self.server.POSTbusy:
|
||||
if currTimePOST - self.server.lastPOST < 500:
|
||||
|
@ -17435,6 +17429,13 @@ class PubServer(BaseHTTPRequestHandler):
|
|||
self.server.POSTbusy = True
|
||||
self.server.lastPOST = currTimePOST
|
||||
|
||||
uaStr = self._getUserAgent()
|
||||
|
||||
if self._blockedUserAgent(callingDomain, uaStr):
|
||||
self._400()
|
||||
self.server.POSTbusy = False
|
||||
return
|
||||
|
||||
if not self.headers.get('Content-type'):
|
||||
print('Content-type header missing')
|
||||
self._400()
|
||||
|
|
Loading…
Reference in New Issue