refs #708 handle some invalid URLs and return 404

unification2
Natalia Serrano 2024-09-19 14:15:01 +02:00
parent 8c9fc6be3f
commit 8a369923ec
1 changed files with 2 additions and 0 deletions

View File

@ -88,6 +88,8 @@ class HTTPServerHandler(BaseHTTPRequestHandler):
Locates witch module will process the message based on path (first folder on url path) Locates witch module will process the message based on path (first folder on url path)
""" """
try: try:
if module is None:
raise Exception ({ '_httpcode': 404, '_msg': f'Module {path[0]} not found' })
data = module.processServerMessage(path, get_params, post_params, self) data = module.processServerMessage(path, get_params, post_params, self)
self.sendJsonResponse(data) self.sendJsonResponse(data)
except Exception as e: except Exception as e: