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

Regression - HTTP status code wrong on api errors #2627

Open
Taloth opened this issue Jun 6, 2019 · 0 comments
Open

Regression - HTTP status code wrong on api errors #2627

Taloth opened this issue Jun 6, 2019 · 0 comments
Assignees
Labels

Comments

@Taloth
Copy link

Taloth commented Jun 6, 2019

First Affected Version: v0.8.1.0 (2017)

Steps to reproduce the behaviour

  • Call the /api?t=abcd

Expected behaviour

HTTP Response with status code 200 OK, containing a xml error message <error code="202" description="No such function"/>

Actual behaviour

HTTP Response with status code 202 (Accepted), containing the correct xml error message.

Details

http_response_code($status);
Causes every api error code to be used as http statuscode. So an 100 'invalid user credentials' would be returned as 'HTTP 100 Continue' Instead of 'HTTP 200 OK'.

Btw. Http status code 429 is a useful response when the user's grab limit has been exceeded. Which was originally attempted in commit 9ffe607.
Although ideally that should include a Retry-After header to supply the client with the appropriate delay until the next 'grab' becomes available. Probably better to have a separate function for that one.

@niel niel self-assigned this Jun 7, 2019
@niel niel added the BUG label Jun 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants