diff options
author | Damian Minkov <damencho@jitsi.org> | 2015-05-04 15:39:50 +0300 |
---|---|---|
committer | Damian Minkov <damencho@jitsi.org> | 2015-05-04 15:39:50 +0300 |
commit | f46a0bfdf2686b4c703710df80ce381e3896627d (patch) | |
tree | 96b8d68c520bd404e88129693faeace9293c0304 /src/net/java/sip/communicator/impl | |
parent | d6cf5521bd739538e23e533d31c9e2aaedacde8b (diff) | |
download | jitsi-f46a0bfdf2686b4c703710df80ce381e3896627d.zip jitsi-f46a0bfdf2686b4c703710df80ce381e3896627d.tar.gz jitsi-f46a0bfdf2686b4c703710df80ce381e3896627d.tar.bz2 |
Combines use of custom header for list values and the factory for rest of the cases.
Diffstat (limited to 'src/net/java/sip/communicator/impl')
-rw-r--r-- | src/net/java/sip/communicator/impl/protocol/sip/ConfigHeaders.java | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/src/net/java/sip/communicator/impl/protocol/sip/ConfigHeaders.java b/src/net/java/sip/communicator/impl/protocol/sip/ConfigHeaders.java index 0044211..c24e0ca 100644 --- a/src/net/java/sip/communicator/impl/protocol/sip/ConfigHeaders.java +++ b/src/net/java/sip/communicator/impl/protocol/sip/ConfigHeaders.java @@ -142,13 +142,26 @@ public class ConfigHeaders try { - - Header customHeader = new CustomHeader( - headerValues.get(ACC_PROPERTY_CONFIG_HEADER_NAME), - processParams( - headerValues.get(ACC_PROPERTY_CONFIG_HEADER_VALUE), - request) - ); + String name = headerValues.get(ACC_PROPERTY_CONFIG_HEADER_NAME); + String value = processParams( + headerValues.get(ACC_PROPERTY_CONFIG_HEADER_VALUE), + request); + + Header customHeader; + + // use the custom header for those custom headers that has + // multiple values, as the factory will switch on the header + // parser for standard headers and will produce multiple headers + // that ends with an error creating/sending the request + if(value.contains(",")) + { + customHeader = new CustomHeader(name, value); + } + else + { + customHeader = protocolProvider.getHeaderFactory() + .createHeader(name, value); + } request.setHeader(customHeader); } |