Small refactor

This commit is contained in:
clearml 2025-06-04 11:59:39 +03:00
parent 34a9f29465
commit 0a02b7ad63
2 changed files with 5 additions and 2 deletions

View File

@ -110,7 +110,7 @@
# Serving # Serving
1050: ["invalid_container_id", "invalid container id"] 1050: ["invalid_container_id", "invalid container id"]
1051: ["container_not_registered", "container is not registered"] 1051: ["container_not_registered", "container is not registered"]
1052: ["no_containers_for_url", "no container instances found for serice url"] 1052: ["no_containers_for_url", "no container instances found for service url"]
1104: ["invalid_scroll_id", "Invalid scroll id"] 1104: ["invalid_scroll_id", "Invalid scroll id"]
} }

View File

@ -43,6 +43,9 @@ class RequestHandlers:
settings["domain"] = domain settings["domain"] = domain
return settings return settings
def _get_identity_from_encoded_token(self, encoded: str):
return Token.decode_identity(encoded)
def before_request(self): def before_request(self):
if request.method == "OPTIONS": if request.method == "OPTIONS":
return "", 200 return "", 200
@ -105,7 +108,7 @@ class RequestHandlers:
# Setting a cookie, let's try to figure out the company # Setting a cookie, let's try to figure out the company
# noinspection PyBroadException # noinspection PyBroadException
try: try:
company = Token.decode_identity(value).company company = self._get_identity_from_encoded_token(value).company
except Exception: except Exception:
pass pass