Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API client: Enable fallback on status code 501, too #802

Merged
merged 1 commit into from Sep 10, 2020
Merged

Commits on Sep 10, 2020

  1. API client: Enable fallback on status code 501, too

    When discussing #801, I remembered #794. While dealing with the
    latter, I read the HTTP RFC, stumbling upon the following:
    
        When a request method is received
        that is unrecognized or not implemented by an origin server, the
        origin server SHOULD respond with the 501 (Not Implemented) status
        code.  When a request method is received that is known by an origin
        server but not allowed for the target resource, the origin server
        SHOULD respond with the 405 (Method Not Allowed) status code.
    
    Concluding from that, it is possible that a server desiring a fallback
    to GET will send a status code of 501. It is even preferred if that
    server does not offer any resource to be used with the POST method.
    
    Therefore, I think we should fallback to GET on a 501, too.
    
    Signed-off-by: beorn7 <beorn@grafana.com>
    beorn7 committed Sep 10, 2020
    Copy the full SHA
    64b4a9c View commit details
    Browse the repository at this point in the history