Skip to content

Commit 85263ce

Browse files
authored
Change GraphProxy.java contentType condition to prevent re-encoding of response (#678)
AzureAD Graph API has changed the MIME Type like `application/json;odata.metadata=minimal;odata.streaming=true;IEEE754Compatible=false`, which is `String#equals` cannot cover.
1 parent ddeb114 commit 85263ce

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/com/microsoft/jenkins/azuread/GraphProxy.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ private void proxy(StaplerRequest2 request, StaplerResponse2 response) throws IO
146146
response.addHeader("client-request-id", okResp.header("client-request-id"));
147147
ResponseBody body = okResp.body();
148148
if (body != null) {
149-
if ("application/json".equals(contentType)) {
149+
if (contentType.startsWith("application/json")) {
150150
String string = body.string();
151151
response.getWriter().write(string);
152152
} else {

0 commit comments

Comments
 (0)