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 424975f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ 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);
if (ct != null) {
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 @@ -123,7 +123,9 @@ private void processRequest(Message message, Exchange exchange) throws IOExcepti
List<String> ctHeaderValues = protocolHeaders.get(Message.CONTENT_TYPE);
if (ctHeaderValues != null && !ctHeaderValues.isEmpty()) {
requestContentType = ctHeaderValues.get(0);
message.put(Message.CONTENT_TYPE, requestContentType);
if (requestContentType != null && !requestContentType.isBlank()) {
message.put(Message.CONTENT_TYPE, requestContentType);
}
}
if (requestContentType == null) {
requestContentType = (String)message.get(Message.CONTENT_TYPE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -379,9 +379,11 @@ private boolean isWSAddressingReplyToSpecified(Exchange ex) {
}
}
String contentType = req.getContentType();
inMessage.put(Message.CONTENT_TYPE, contentType);
setEncoding(inMessage, req, contentType);
if (contentType != null && !contentType.isBlank()) {
inMessage.put(Message.CONTENT_TYPE, contentType);
}

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

inMessage.put(Message.ACCEPT_CONTENT_TYPE, req.getHeader("Accept"));
Expand Down

0 comments on commit 424975f

Please sign in to comment.