refs #1784 ignore module name in URLs

override-module
Natalia Serrano 2025-03-31 11:54:17 +02:00
parent f1c3cd2460
commit 9af7469fc7
3 changed files with 13 additions and 3 deletions

View File

@ -1,4 +1,10 @@
ogagent (2.0.0-1) UNRELEASED; urgency=medium
ogagent (3.0.0-1) stable; urgency=medium
* Ignore module provided in the URLs to the API
-- OpenGnsys developers <info@opengnsys.es> Mon, 31 Mar 2025 10:16:07 +0200
ogagent (2.0.0-1) stable; urgency=medium
* EjecutarScript/ConsolaRemota: expect "scp" parameter encoded in base64

View File

@ -1 +1 @@
2.0.0
3.0.0

View File

@ -30,6 +30,7 @@
"""
import os
import json
import ssl
import threading
@ -77,8 +78,11 @@ class HTTPServerHandler(BaseHTTPRequestHandler):
except Exception:
params = {}
## quick override because universities do not actually want the module to be extracted out of the URL
module = 'ogAdmClient' if os.path.exists ('/scripts/oginit') else 'opengnsys'
for v in self.service.modules:
if v.name == path[0]: # Case Sensitive!!!!
if v.name == module: # Case Sensitive!!!!
return v, path[1:], params
return None, path, params