INT-3903: user prefix as "" for HTTP headers

JIRA: https://jira.spring.io/browse/INT-3903

According to RFC-6648, the "X-" prefix has been deprecated and now any use-specific headers can be mapped without any prefix

* Fix `DefaultHttpHeaderMapper` for the `""` as a `userDefinedHeaderPrefix` by default

Document `X-` changes
This commit is contained in:
Artem Bilan
2016-10-10 12:17:01 -04:00
committed by Gary Russell
parent f9e93e0a72
commit 53d80b5694
6 changed files with 48 additions and 33 deletions

View File

@@ -515,7 +515,7 @@ The configuration looks very similar to the gateway:
[NOTE]
=====
To specify the URL; you can use either the 'url' attribute or the 'url-expression' attribute.
The 'url' is a simple string (with placedholders for URI variables, as described below); the 'url-expression' is a SpEL expression, with the Message as the root object, enabling dynamic urls.
The 'url' is a simple string (with placeholders for URI variables, as described below); the 'url-expression' is a SpEL expression, with the Message as the root object, enabling dynamic urls.
The url resulting from the expression evaluation can still have placeholders for URI variables.
In previous releases, some users used the place holders to replace the entire URL with a URI variable.
@@ -774,6 +774,11 @@ The adapters and gateways will use the `DefaultHttpHeaderMapper` which now provi
If further customization is required you can also configure a `DefaultHttpHeaderMapper` independently and inject it into the adapter via the `header-mapper` attribute.
Before _version 5.0_, the `DefaultHttpHeaderMapper` the default prefix for user-defined, non-standard HTTP headers was `X-`.
In `_version 5.0_` this has been changed to an empty string.
According to https://tools.ietf.org/html/rfc6648[RFC-6648], the use of such prefixes is now discouraged.
This option can still be customized by setting the `DefaultHttpHeaderMapper.setUserDefinedHeaderPrefix()` property.
[source,xml]
----
<int-http:outbound-gateway id="httpGateway"

View File

@@ -60,3 +60,8 @@ See <<barrier>> for more information.
The AMQP outbound endpoints now support setting a delay expression for when using the RabbitMQ Delayed Message Exchange plugin.
See <<amqp-delay>> for more information.
==== HTTP Changes
The `DefaultHttpHeaderMapper.userDefinedHeaderPrefix` property is now an empty string by default instead of `X-`.
See <<http-header-mapping>> for more information.