mirror of
https://github.com/seemoo-lab/opendrop.git
synced 2026-09-16 16:16:12 -04:00
400 response for invalid POST URL
This commit is contained in:
+4
-3
@@ -298,9 +298,10 @@ class AirDropServerHandler(BaseHTTPRequestHandler):
|
|||||||
elif self.path == '/Upload':
|
elif self.path == '/Upload':
|
||||||
self.handle_upload()
|
self.handle_upload()
|
||||||
else:
|
else:
|
||||||
answer = 'POST request for {}'.format(self.path).encode('utf-8')
|
logger.debug('POST request at {}'.format(self.path))
|
||||||
self._set_response(len(answer))
|
self.send_response(400)
|
||||||
self.wfile.write(answer)
|
self.send_header('Content-Length', 0)
|
||||||
|
self.end_headers()
|
||||||
|
|
||||||
def log_message(self, format, *args):
|
def log_message(self, format, *args):
|
||||||
logger.debug('{} - - [{}] {}'.format(self.client_address[0], self.log_date_time_string(), format % args))
|
logger.debug('{} - - [{}] {}'.format(self.client_address[0], self.log_date_time_string(), format % args))
|
||||||
|
|||||||
Reference in New Issue
Block a user