Repository navigation
fix: sign in over HTTPS when the server requires it - #1932
ranjithguggilla wants to merge 1 commit into
Conversation
An http sign-in against a server that only accepts https fails with 405 after the credentials have already been sent. Probe the unauthenticated serverInfo endpoint first and switch the address to https when that probe redirects or when http is refused and https answers.
|
Thanks for this, @ranjithguggilla. Probing Please fix: the probe ignores The probe calls Please fix: probe failures are logged at INFO
Please fix: The docstring doesn't mention the extra unauthenticated request, or that Question: redirects that change the port The check Tests The three tests cover a 301 to https, a 200 over http, and a 405 on http with a 200 on https. Could you add cases for:
A test for a redirect to a different host (the address should stay on http) is nice to have. Drafted with AI assistance (Claude); reviewed and posted by Jac. |
Closes #1091
Motivation
Signing in to an
http://address when the server requires https fails with 405 Method Not Allowed, and the credentials have already been sent in cleartext. The issue asks the client to check the unauthenticated endpoint and switch to https before the sign-in request.Behavior change
sign_infirst GETsserverInfowith no credentials and without following redirects.serverInfoover http is left on http.Test plan
Three mocked cases: a 301 to https, a 200 over http, and a 405 on http with a 200 on https.
test/test_auth.pyandtest/test_redirect_handling.pypass.Not covered: a live server that redirects http to https.