Skip to content

Commit

Permalink
CXF-8812: Content-Type header created with collection containing 'nul…
Browse files Browse the repository at this point in the history
…l' value
  • Loading branch information
reta committed Jan 15, 2024
1 parent 3b58579 commit d5d3707
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ public org.apache.cxf.message.Message createMessage(org.apache.cxf.message.Messa
if (exchange != null) {
ct = (String)exchange.get(org.apache.cxf.message.Message.CONTENT_TYPE);
}

m.put(org.apache.cxf.message.Message.CONTENT_TYPE, ct);
}
return m;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -380,8 +380,8 @@ private boolean isWSAddressingReplyToSpecified(Exchange ex) {
}
String contentType = req.getContentType();
inMessage.put(Message.CONTENT_TYPE, contentType);
setEncoding(inMessage, req, contentType);

setEncoding(inMessage, req, contentType);
inMessage.put(Message.QUERY_STRING, req.getQueryString());

inMessage.put(Message.ACCEPT_CONTENT_TYPE, req.getHeader("Accept"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,12 @@ protected void copyFromRequest(HttpServletRequest req) {
}
}
if (!headers.containsKey(Message.CONTENT_TYPE)) {
headers.put(Message.CONTENT_TYPE, Collections.singletonList(req.getContentType()));
final String contentType = req.getContentType();
if (contentType != null) {
headers.put(Message.CONTENT_TYPE, Collections.singletonList(contentType));
} else {
headers.put(Message.CONTENT_TYPE, null);
}
}
if (LOG.isLoggable(Level.FINE)) {
Map<String, List<Object>> theHeaders = CastUtils.cast(headers);
Expand Down

0 comments on commit d5d3707

Please sign in to comment.