changeset 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 93147b89ea67
children a6b3b41a116c
files mod_http_oauth2/mod_http_oauth2.lua
diffstat 1 files changed, 1 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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");