mod_http_oauth2: Set content type on successful repsponses (fixes #1501)
authorKim Alvefur <zash@zash.se>
Sun, 08 Mar 2020 13:42:55 +0100
changeset 3938 469408682152
parent 3937 93147b89ea67
child 3943 a6b3b41a116c
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.
mod_http_oauth2/mod_http_oauth2.lua
--- a/mod_http_oauth2/mod_http_oauth2.lua	Sun Mar 08 12:52:18 2020 +0100
+++ b/mod_http_oauth2/mod_http_oauth2.lua	Sun Mar 08 13:42:55 2020 +0100
@@ -67,6 +67,7 @@
 end
 
 function handle_token_grant(event)
+	event.response.headers.content_type = "application/json";
 	local params = http.formdecode(event.request.body);
 	if not params then
 		return oauth_error("invalid_request");