#1500 mod_http_oauth2 returns different JSON depending on whether Accept: application/json is set or not
Reporter
Jonas Schäfer
Owner
Nobody
Created
Updated
Stars
★ (1)
Tags
Status-Fixed
Type-Defect
Priority-Medium
Jonas Schäfer
on
What steps will reproduce the problem?
1. Send a OAuth2 bearer token request with invalid credentials
2. Set Accept: application/json
3. Do not set Accept: application/json
What is the expected output?
The result of (2) and (3) should be identical.
What do you see instead?
(2) returns {'error': {'condition': 'bad-request', 'code': 400, 'context': {'oauth2_response': {'error': 'invalid_grant', 'error_description': 'incorrect credentials'}}, 'type': 'modify', 'text': 'invalid_grant: incorrect credentials'}, 'type': 'error', 'code': 400}
(3) returns {'error': 'invalid_grant', 'error_description': 'incorrect credentials'}
What version of the product are you using? On what operating system?
changeset: 3932:8b34222216f4
Please provide any additional information below.
Not setting Accept: application/json delivers HTTP error pages on some error conditions, which isn’t ideal either.
What steps will reproduce the problem? 1. Send a OAuth2 bearer token request with invalid credentials 2. Set Accept: application/json 3. Do not set Accept: application/json What is the expected output? The result of (2) and (3) should be identical. What do you see instead? (2) returns {'error': {'condition': 'bad-request', 'code': 400, 'context': {'oauth2_response': {'error': 'invalid_grant', 'error_description': 'incorrect credentials'}}, 'type': 'modify', 'text': 'invalid_grant: incorrect credentials'}, 'type': 'error', 'code': 400} (3) returns {'error': 'invalid_grant', 'error_description': 'incorrect credentials'} What version of the product are you using? On what operating system? changeset: 3932:8b34222216f4 Please provide any additional information below. Not setting Accept: application/json delivers HTTP error pages on some error conditions, which isn’t ideal either.
Fixed in https://hg.prosody.im/prosody-modules/rev/93147b89ea67. Please test.
ChangesWorks, thanks!