Make post user agent checking subject to busy flag

main
Bob Mottram 2021-12-10 15:59:46 +00:00
parent 4ddabb896a
commit 013fb6cffd
1 changed files with 7 additions and 6 deletions

View File

@ -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()