From 7da96e98b0bf59d0cfed7f455c4c2c27db3b679e Mon Sep 17 00:00:00 2001 From: Stephan Richter Date: Sun, 20 Oct 2024 21:59:18 +0200 Subject: [PATCH] implemented sending media type on token request (and others) Signed-off-by: Stephan Richter --- .../src/main/java/de/srsoftware/http/PathHandler.java | 1 + .../src/main/java/de/srsoftware/oidc/backend/UserController.java | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/de.srsoftware.http/src/main/java/de/srsoftware/http/PathHandler.java b/de.srsoftware.http/src/main/java/de/srsoftware/http/PathHandler.java index 6c3afc0..f1d5bb9 100644 --- a/de.srsoftware.http/src/main/java/de/srsoftware/http/PathHandler.java +++ b/de.srsoftware.http/src/main/java/de/srsoftware/http/PathHandler.java @@ -178,6 +178,7 @@ public abstract class PathHandler implements HttpHandler { if (o instanceof List list) o = new JSONArray(list); if (o instanceof Map map) o = new JSONObject(map); if (o instanceof Error error) o = error.json(); + if (o instanceof JSONObject) ex.getResponseHeaders().add(CONTENT_TYPE, JSON); return sendContent(ex, status, o.toString().getBytes(UTF_8)); } diff --git a/de.srsoftware.oidc.backend/src/main/java/de/srsoftware/oidc/backend/UserController.java b/de.srsoftware.oidc.backend/src/main/java/de/srsoftware/oidc/backend/UserController.java index f915fe8..52e945a 100644 --- a/de.srsoftware.oidc.backend/src/main/java/de/srsoftware/oidc/backend/UserController.java +++ b/de.srsoftware.oidc.backend/src/main/java/de/srsoftware/oidc/backend/UserController.java @@ -21,7 +21,6 @@ import jakarta.mail.*; import jakarta.mail.internet.*; import java.io.IOException; import java.time.Duration; -import java.util.Comparator; import java.util.Map; import java.util.Optional; import java.util.Set;