SachinyadavAug20 commented on code in PR #77209:
URL: https://github.com/apache/airflow/pull/77209#discussion_r4609196032
##########
providers/amazon/src/airflow/providers/amazon/aws/auth_manager/routes/login.py:
##########
@@ -205,6 +207,27 @@ def _start_login(request: Request, mode: str) ->
RedirectResponse:
}
)
_write_pending_logins(request, response, pending)
+ if mode == LOGIN_MODE_REDIRECT:
+ cookie_path = get_cookie_path()
+ secure = _is_secure_request(request)
+ next_url = request.query_params.get("next")
+ if next_url and is_safe_url(next_url, request=request):
+ response.set_cookie(
Review Comment:
Thanks for catching this! Because pending entries are JSON-serialized and
base64-encoded in `_awsam_login_state`, URLs with non-Latin-1 characters (such
as `next=/dags?search=日本`) are safely encoded in ASCII and no longer raise
`UnicodeEncodeError`. Added a unit test to verify this explicitly.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]