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

Do not convert @Header name when the name is specified #5841

Merged
merged 3 commits into from
Jul 30, 2024

Conversation

minwoox
Copy link
Contributor

@minwoox minwoox commented Jul 29, 2024

Motivation:
We must not convert the header name specified in @Header when creating an annotated service.
This is a regression introduced by #5547, affecting 1.29.0 through 1.29.3.

Modifications:

  • Do not convert the header name specified in @Header.

Result:

  • An annotated service that has a @Header with the specified name now works correctly.

Motivation:
We must not convert the header name specified in `@Header` when creating an annotated service.

Modifications:
- Do not convert the header name specified in `@Header`.

Result:
- An annotated service that has a `@Header` with the specified name now works correctly.
@@ -773,6 +773,12 @@ public String customHeader5(@Header List<Integer> numbers,
String.join(":", strings);
}

@Post("/headerNameSpecified")
public String headerNameSpecified(@Header("X-Line-Id") String id) {
Copy link
Member

Choose a reason for hiding this comment

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

Can we use more peculiar casing? e.g. X-x-FoO-bAr ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks updated. 😉

@minwoox minwoox added this to the 1.29.4 milestone Jul 29, 2024
Copy link
Contributor

@ikhoon ikhoon left a comment

Choose a reason for hiding this comment

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

Thanks!

@@ -44,6 +44,27 @@ static String findName(Object nameRetrievalTarget, String value) {
return getName(nameRetrievalTarget);
}

/**
* Returns the value of the {@link Header} annotation which is specified on the {@code element} if
Copy link
Contributor

Choose a reason for hiding this comment

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

Shoud we update Javadoc of the method above?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, fixed. 😉

Copy link
Contributor

@jrhee17 jrhee17 left a comment

Choose a reason for hiding this comment

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

👍 👍 👍 👍

@minwoox minwoox merged commit cd1973b into line:main Jul 30, 2024
15 checks passed
@minwoox minwoox deleted the header_name branch July 30, 2024 05:44
minwoox added a commit to minwoox/armeria that referenced this pull request Jul 30, 2024
Motivation:
We must not convert the header name specified in `@Header` when creating an annotated service.
This is a regression introduced by line#5547, affecting 1.29.0 through 1.29.3.

Modifications:
- Do not convert the header name specified in `@Header`.

Result:
- An annotated service that has a `@Header` with the specified name now works correctly.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants