SpringSource/spring-integration — pull request #618 by garyrussell (2012-09-11 20:49:20+00:00)
Title: INT-2744 Mechanism to Suppress Standard Headers

This might be considered a little kludgy but it works, and
it does provide a mechanism to relatively easily suppress
additional headers as needed, without requiring an SI release.

Currently, HTTP mappers don't know if they are inbound
or outbound. This causes problems with mapping certain
headers.

For example, on an inbound adapter, a mapped Content-Length
header should not be re-mapped to an HTTP Header during
response header mapping. However, the Content-Length
does need to be mapped on an outbound adapter response.

Introduce the notion of an exclusion list for both
request and response standard headers.

If a mapper has been configured to use standard headers,
we can detect whether the mapper is being used for inbound
or outbound mapping. We can then apply an 'exclusion' for
certain headers.

Currently, no request headers are suppressed on outbound
mappers and only the 'Content-Length' response header
is suppressed on inbound mappers.

The default mappers created via the static factory
methods use these defaults. Exposing the exclusion setters
will allow users to suppress additional headers, if
deemed necessary.