mirror of https://gitlab.com/bashrc2/epicyon
Reject attempts to get python files
parent
d37fcf9e2f
commit
59243e9b58
|
|
@ -311,6 +311,12 @@ def daemon_http_get(self) -> None:
|
||||||
http_404(self, 145)
|
http_404(self, 145)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
# py
|
||||||
|
if self.path.endswith('.py'):
|
||||||
|
print('GET HTTP Attempt to access Python file ' + self.path)
|
||||||
|
http_404(self, 146)
|
||||||
|
return
|
||||||
|
|
||||||
if contains_invalid_chars(str(self.headers)):
|
if contains_invalid_chars(str(self.headers)):
|
||||||
print('GET HTTP headers contain invalid characters ' +
|
print('GET HTTP headers contain invalid characters ' +
|
||||||
str(self.headers))
|
str(self.headers))
|
||||||
|
|
|
||||||
|
|
@ -122,6 +122,12 @@ def daemon_http_post(self) -> None:
|
||||||
http_404(self, 146)
|
http_404(self, 146)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
# py
|
||||||
|
if self.path.endswith('.py'):
|
||||||
|
print('POST HTTP Attempt to access Python file ' + self.path)
|
||||||
|
http_404(self, 146)
|
||||||
|
return
|
||||||
|
|
||||||
calling_domain = self.server.domain_full
|
calling_domain = self.server.domain_full
|
||||||
if self.headers.get('Host'):
|
if self.headers.get('Host'):
|
||||||
calling_domain = decoded_host(self.headers['Host'])
|
calling_domain = decoded_host(self.headers['Host'])
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue