Skip to content

Resolve placeholders before parsing request headers - #1405

Merged
ryanjbaxter merged 2 commits into
spring-cloud:mainfrom
yashdotdev13:issue-290-placeholder-headers
Aug 26, 2026
Merged

Resolve placeholders before parsing request headers#1405
ryanjbaxter merged 2 commits into
spring-cloud:mainfrom
yashdotdev13:issue-290-placeholder-headers

Conversation

@yashdotdev13

Copy link
Copy Markdown
Contributor

Description

Resolves property placeholders in the complete RequestMapping.headers expression before parsing the header name and value.

Previously, placeholders worked when used as part of a header value:

headers = "myHeader=${my.header.value}"

@ryanjbaxter

Copy link
Copy Markdown
Contributor

Was there a change that broke this functionality?

@yashdotdev13

Copy link
Copy Markdown
Contributor Author

I looked through the history, and I couldn't identify a specific change that broke this functionality.

It appears that placeholder resolution for header names and values has been supported, but resolving a placeholder for the entire RequestMapping.headers expression was not handled. The existing parsing logic looks for = before resolving the expression, so a value such as ${feignClient.placeholderHeader} is treated as a complete header expression without first being resolved.

The existing getHelloHeadersPlaceholders() test has been present since the initial commit, and the history suggests this particular case was not previously supported rather than being broken by a recent change.

My change resolves the header expression before parsing it, allowing placeholders that resolve to a complete name=value header expression while preserving the existing behavior for placeholders used within the header name or value.

@ryanjbaxter ryanjbaxter added enhancement New feature or request and removed waiting-for-triage labels Aug 26, 2026
@ryanjbaxter ryanjbaxter added this to the 5.0.4 milestone Aug 26, 2026
@github-project-automation github-project-automation Bot moved this to Todo in 2025.1.4 Aug 26, 2026
Signed-off-by: 98001yash <yashchauhan.gaya@gmail.com>
@yashdotdev13
yashdotdev13 force-pushed the issue-290-placeholder-headers branch from 8c850db to 6fbb840 Compare August 26, 2026 15:53
@ryanjbaxter

Copy link
Copy Markdown
Contributor

Could you merge in the lates changes from main into your branch please before I merge this? Thanks!

…er-headers

Signed-off-by: 98001yash <yashchauhan.gaya@gmail.com>
@yashdotdev13

Copy link
Copy Markdown
Contributor Author

Done, thanks! I've merged the latest changes from main into my branch and verified that the tests pass.

@ryanjbaxter
ryanjbaxter merged commit 01b74d4 into spring-cloud:main Aug 26, 2026
2 checks passed
@github-project-automation github-project-automation Bot moved this from Todo to Done in 2025.1.4 Aug 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants