Add a client-side HTTP method fallback for pre-24.03.7 servers for `session-download` function
- Dominant language
- Python
- Stars
- 670
- Forks
- 183
- Avg merge
- 17h 7m
- Merged PRs (30d)
- 358
Description
After #2635 has been applied (24.03.7+), the manager now accepts POST requests while replying the GET requests with a deprecation warning (HTTP 400 Bad Request) for the session-download API (`backend.ai session download` command), which is often used to fetch a random-generated or user-configured `id_container` SSH private key in various client-side SSH applications such as `backend.ai ssh` command.
The problem is that when using a latest client, a server older than 24.03.7 simply rejects the POST requests with HTTP 405 Method Not Allowed error, which may surprise the latest client SDK users who use it against our cloud (24.03.4 now).
Let's add a fallback mechanism to the client so that it retries using the GET method when it observes 405, so that it could work with old servers as well.
JIRA Issue: BA-31
Contributor guide
Assessment
This issue has not been assessed yet.