spring-projects / spring-framework

Spring Framework
https://spring.io/projects/spring-framework
Apache License 2.0
56.69k stars 38.15k forks source link

@RequestHeader name/value does not accept placeholders [SPR-13952] #18525

Closed spring-projects-issues closed 8 years ago

spring-projects-issues commented 8 years ago

Bjorn Harvold opened SPR-13952 and commented

I would like to be able to control the name of my auth token per environment. Ergo, I would like to be able to do something like this:

@RequestHeader(value = "${env.auth.token}", required = true)

Currently, this only works with a constant string.


Affects: 4.2.4

Issue Links:

Referenced from: commits https://github.com/spring-projects/spring-framework/commit/e0d7c6be00ed855e473f19f405ddbbcdb6cbb885

spring-projects-issues commented 8 years ago

Juergen Hoeller commented

As of 4.3, we resolve all such name attributes (which are mirrored as value) on handler method arguments, the same way that we process defaultValue already. This means that placeholders as well expressions are getting evaluated now.

Juergen