comparison mod_http_oauth2/mod_http_oauth2.lua @ 3934:469408682152

mod_http_oauth2: Set content type on successful repsponses (fixes #1501) This will set the content-type on all responses, tho errors are already taken care of in the error handler.
author Kim Alvefur <zash@zash.se>
date Sun, 08 Mar 2020 13:42:55 +0100
parents cf92e3b30c18
children 3eb595cf847f
comparison
equal deleted inserted replaced
3933:93147b89ea67 3934:469408682152
65 return oauth_error("invalid_grant", "incorrect credentials"); 65 return oauth_error("invalid_grant", "incorrect credentials");
66 end 66 end
67 end 67 end
68 68
69 function handle_token_grant(event) 69 function handle_token_grant(event)
70 event.response.headers.content_type = "application/json";
70 local params = http.formdecode(event.request.body); 71 local params = http.formdecode(event.request.body);
71 if not params then 72 if not params then
72 return oauth_error("invalid_request"); 73 return oauth_error("invalid_request");
73 end 74 end
74 local grant_type = params.grant_type 75 local grant_type = params.grant_type