Namespace parser should interpret blank header mapping as "map no headers" [INT-3010]
Nathan Williams opened INT-3010 and commented
The reference guide (15.7) explains that providing a value in a mapped-headers attribute overrides the default header mapping logic and maps only those headers which you specify. This implies that leaving the attribute blank would not map any headers, but this is not currently the case. A blank attribute is effectively ignored.
Making up a fake header name like "none" and passing that as the value does accomplish the desired effect, but this workaround is not immediately intuitive. It would be preferable if declaring the attribute, but leaving it blank resulted in a blank list of headers to map.
Affects: 2.2.3
Reference URL: http://forum.springsource.org/showthread.php?137180-Blank-HTTP-Header-Mapping
Artem Bilan commented
Hi! how about this
mapped-request-headers="-"
? And don't do anything as "New Feature"
Nathan Williams commented
Now that I understand how the attribute is interpreted, "-" or "none" or any other fake name is adequate as a workaround, but I spent an unfortunate amount of time going in circles (and stepping through code) before I reached that understanding. To my thinking, prioritizing the default behavior when an attribute for overriding the default has been explicitly provided doesn't make much sense, but I understand that there may be broader concerns of consistency or backwards compatibility that the team prefers to observe. If so, then I would still suggest a documentation update to help others avoid making the same bad assumption that I did.