forked from indymedia/epicyon
Early blocking of domains
parent
4e2e1dab21
commit
279f6ece20
16
daemon.py
16
daemon.py
|
@ -915,6 +915,14 @@ class PubServer(BaseHTTPRequestHandler):
|
|||
return locatePost(baseDir,nickname,domain,messageId),nickname
|
||||
|
||||
def do_GET(self):
|
||||
callingDomain=None
|
||||
if self.headers.get('Host'):
|
||||
callingDomain=self.headers['Host']
|
||||
if isBlockedDomain(self.server.baseDir,callingDomain):
|
||||
print('GET domain blocked: '+callingDomain)
|
||||
self._400()
|
||||
return
|
||||
|
||||
GETstartTime=time.time()
|
||||
GETtimings=[]
|
||||
|
||||
|
@ -4282,6 +4290,14 @@ class PubServer(BaseHTTPRequestHandler):
|
|||
return
|
||||
self.server.lastPOST=currTimePOST
|
||||
|
||||
callingDomain=None
|
||||
if self.headers.get('Host'):
|
||||
callingDomain=self.headers['Host']
|
||||
if isBlockedDomain(self.server.baseDir,callingDomain):
|
||||
print('POST domain blocked: '+callingDomain)
|
||||
self._400()
|
||||
return
|
||||
|
||||
self.server.POSTbusy=True
|
||||
if not self.headers.get('Content-type'):
|
||||
print('Content-type header missing')
|
||||
|
|
Loading…
Reference in New Issue