📜 ⬆️ ⬇️

Parameter HTTP Header Transfer for Apache CXF

Prehistory:


According to RFC-2616 , the HTTP header can be sent in a bunch of different ways.
We used the option KEY = <VALUE-1>, <VALUE-2>, ..., <VALUE-N>
The Apache CXF library up to version 2.5.8 (inclusive) handled this situation correctly.

Problem:


Since version 2.5.9, Apache CXF has quietly “improved” and only KEY = <VALUE> are recognized as valid
There is no answer to the question in the documentation or on the Apache forum:

How to allow Apache CXF to accept HTTP request header parameters (HTTP header), separated by commas?
')
An examination of the library's source code indicated a solution to the problem.

Decision:


In the beans.xml config, add:

<jaxrs:properties> <!-- enable comma separated HTTP header values. Example" "X-ListID: 0,100,13,25,16" --> <entry key="org.apache.cxf.http.header.split" value="true" /> </jaxrs:properties> 

Source: https://habr.com/ru/post/179025/


All Articles