500 error when auth is null for a UIA request #15871
Pull Request Checklist
authdict = clientdict.pop("auth", {})
if "session" in authdict:
sid = authdict["session"]
# Convert the URI and method to strings.
uri = request.uri.decode("utf-8")
method = request.method.decode("utf-8")
# If there's no session ID, create a new session.
if not sid:
new_session_data = get_new_session_data() if get_new_session_data else {}
session = await self.store.create_ui_auth_session(
clientdict, uri, method, description
)
Above one is the original code:
when we put condition this:
authdict = clientdict.pop("auth", {})
if "session" in authdict:
sid = authdict["session"]
# Convert the URI and method to strings.
uri = request.uri.decode("utf-8")
method = request.method.decode("utf-8")
# If there's no session ID, create a new session. // handling code
if not sid:
new_session_data = get_new_session_data() if get_new_session_data else {}
session = await self.store.create_ui_auth_session(
clientdict, uri, method, description
)
it will work because we are avoiding null values if it occurs it we handled by the handling code
500 error when auth is null for a UIA request #15871
Pull Request Checklist
authdict = clientdict.pop("auth", {}) if "session" in authdict: sid = authdict["session"]
Above one is the original code:
when we put condition this: authdict = clientdict.pop("auth", {}) if "session" in authdict: sid = authdict["session"]
it will work because we are avoiding null values if it occurs it we handled by the handling code