Skip to content

Resolve placeholders before parsing request headers - #1405

Open
yashdotdev13 wants to merge 1 commit into
spring-cloud:mainfrom
yashdotdev13:issue-290-placeholder-headers
Open

Resolve placeholders before parsing request headers#1405
yashdotdev13 wants to merge 1 commit 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}"

Signed-off-by: 98001yash <yashchauhan.gaya@gmail.com>
@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants