You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by zr...@apache.org on 2018/01/10 14:43:10 UTC

[camel] branch master updated: CAMEL-12085: Don't mandate header case for cust...

This is an automated email from the ASF dual-hosted git repository.

zregvart pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/master by this push:
     new 1dc9315  CAMEL-12085: Don't mandate header case for cust...
1dc9315 is described below

commit 1dc9315f0b6f5ce8b7e2a7e8000e17307af7a676
Author: Zoran Regvart <zr...@apache.org>
AuthorDate: Wed Jan 10 15:43:08 2018 +0100

    CAMEL-12085: Don't mandate header case for cust...
    
    ...om Salesforce HTTP haders
    
    The fix in CAMEL-12092 missed second header filter in
    `SalesforceProcessor`, this fixes at the second location as well.
    
    Based on a patch submitted by Dicken George.
---
 .../component/salesforce/internal/processor/SalesforceProcessor.java  | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/processor/SalesforceProcessor.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/processor/SalesforceProcessor.java
index e2a506e..0a480d0 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/processor/SalesforceProcessor.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/processor/SalesforceProcessor.java
@@ -21,6 +21,7 @@ import java.util.Collection;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
+import java.util.Locale;
 import java.util.Map;
 import java.util.stream.Collectors;
 
@@ -40,7 +41,8 @@ public interface SalesforceProcessor extends Service {
 
         final Map<String, List<String>> answer = new HashMap<>();
         for (final String headerName : headers.keySet()) {
-            if (headerName.startsWith("Sforce") || headerName.startsWith("x-sfdc")) {
+            final String headerNameLowercase = headerName.toLowerCase(Locale.US);
+            if (headerNameLowercase.startsWith("sforce") || headerNameLowercase.startsWith("x-sfdc")) {
                 final Object headerValue = inboundMessage.getHeader(headerName);
 
                 if (headerValue instanceof String) {

-- 
To stop receiving notification emails like this one, please contact
['"commits@camel.apache.org" <co...@camel.apache.org>'].