Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support @RequestHeader with HttpHeader/Map/MultiValueMap types. #947

Merged
merged 2 commits into from Mar 29, 2022

Conversation

srinivasankavitha
Copy link
Contributor

Pull Request type

  • Bugfix

Changes in this PR

This PR adds the ability to use @RequestHeader annotation with HttpHeaders, Map<String, String> and MultiValueMap<String, String> types.

Describe the new behavior from this PR, and why it's needed
Issue #934


if (parameter.type.isAssignableFrom(Map::class.java)) {
return getValueAsOptional(requestData?.headers?.toSingleValueMap(), parameter)
} else if (parameter.type.isAssignableFrom(HttpHeaders::class.java) || parameter.type.isAssignableFrom(MultiValueMap::class.java)) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: redundant else

@srinivasankavitha srinivasankavitha merged commit 0823675 into master Mar 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants