Skip to content

Commit

Permalink
The check for content-type of a request needs to be case insensitive j…
Browse files Browse the repository at this point in the history
  • Loading branch information
wluyima committed Mar 22, 2017
1 parent 4577bda commit 591f3e8
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import akka.event.Logging;
import akka.event.LoggingAdapter;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.HttpStatus;
import org.openhim.mediator.denormalization.CSDRequestActor;
import org.openhim.mediator.denormalization.PIXRequestActor;
Expand Down Expand Up @@ -67,7 +68,10 @@ public RepositoryActor(MediatorConfig config) {
private void readMessage() {
contentType = originalRequest.getHeaders().get("Content-Type");

if (contentType!=null && (contentType.contains("multipart/related") || contentType.contains("multipart/form-data"))) {
if (contentType != null
&& (StringUtils.containsIgnoreCase(contentType, "multipart/related") || StringUtils.containsIgnoreCase(
contentType, "multipart/form-data"))) {

log.info("Message is multipart. Parsing contents...");
XDSbMimeProcessorActor.MimeMessage mimeMsg = new XDSbMimeProcessorActor.MimeMessage(originalRequest.getRequestHandler(), getSelf(), originalRequest.getBody(), contentType);
mtomProcessor.tell(mimeMsg, getSelf());
Expand Down

0 comments on commit 591f3e8

Please sign in to comment.