Skip to content

Commit

Permalink
Merge pull request #30839 from Bazalii/30806-fix-accept-header-handling
Browse files Browse the repository at this point in the history
Fix handling of Accept header in graphQL
  • Loading branch information
gsmet authored Feb 4, 2023
2 parents c33c7bf + 4c48dec commit 53087ff
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -223,10 +223,14 @@ private String getRequestAccept(RoutingContext ctx) {
if (isValidAcceptRequest(a.rawValue())) {
return a.rawValue();
}

if (a.rawValue().startsWith("*/*")) {
return DEFAULT_RESPONSE_CONTENT_TYPE;
}
}
// Seems like an unknown accept is passed in
String accept = ctx.request().getHeader("Accept");
if (accept != null && !accept.isEmpty() && !accept.startsWith("*/*")) {
if (accept != null && !accept.isEmpty()) {
return accept;
}
}
Expand Down

0 comments on commit 53087ff

Please sign in to comment.