This PR ensures that every API request from the client has the X-API-version header attached. The client program handles version mismatch errors from the server and raises APIVersionMismatchException with upgrade instructions included. This allows users who are running the client through another program to handle the error the way customarily.
If the user is interacting via the CLI, it prompts for auto-upgrade. On input y (or any positive string accepted by distutils.util.strtobool), the CLI performs the auto-upgrade and exits. Similarly, on n, it instructs to upgrade manually and exits.
Tests (both for the client and CLI) are added to ensure it works.
This PR ensures that every API request from the client has the X-API-version header attached. The client program handles version mismatch errors from the server and raises
APIVersionMismatchException
with upgrade instructions included. This allows users who are running the client through another program to handle the error the way customarily.If the user is interacting via the CLI, it prompts for auto-upgrade. On input
y
(or any positive string accepted bydistutils.util.strtobool
), the CLI performs the auto-upgrade and exits. Similarly, onn
, it instructs to upgrade manually and exits.Tests (both for the client and CLI) are added to ensure it works.