The documentation for the Scheduler HTTP API says:
If requests are made to a non-leading master a “HTTP 307 Temporary Redirect” will be received with the “Location” header pointing to the leading master.
While the redirect functionality has been implemented, it was not actually used in the handler for the HTTP api.
A probable fix could be:
- Check if the current master is the leading master.
- If not, invoke the existing redirect method in src/master/http.cpp