Skip to content

Commit

Permalink
Polishing contribution
Browse files Browse the repository at this point in the history
Closes gh-34230
  • Loading branch information
rstoyanchev committed Jan 15, 2025
1 parent a8c5885 commit 5150a9a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -938,10 +938,10 @@ method parameters:
| Dynamically set the HTTP method for the request, overriding the annotation's `method` attribute

| `@RequestHeader`
| Add a request header or multiple headers. The argument may be a `Map<String, ?>` or
`MultiValueMap<String, ?>` with multiple headers, a `Collection<?>` of values, or an
individual value. Type conversion is supported for non-String values. This does not override
the annotation's `headers` attribute.
| Add a request header or multiple headers. The argument may be a single value,
a `Collection<?>` of values, `Map<String, ?>`,`MultiValueMap<String, ?>`.
Type conversion is supported for non-String values. Header values are added and
do not override already added header values.

| `@PathVariable`
| Add a variable for expand a placeholder in the request URL. The argument may be a
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ void header() {

@Test
void doesNotOverrideAnnotationHeaders() {
this.service.executeWithAnnotationHeaders("test");
assertRequestHeaders("id", "default", "test");
this.service.executeWithAnnotationHeaders("2");
assertRequestHeaders("myHeader", "1", "2");
}

private void assertRequestHeaders(String key, String... values) {
Expand All @@ -73,8 +73,8 @@ private interface Service {
@GetExchange
void execute(@RequestHeader String id);

@HttpExchange(method = "GET", headers = "id=default")
void executeWithAnnotationHeaders(@RequestHeader String id);
@HttpExchange(method = "GET", headers = "myHeader=1")
void executeWithAnnotationHeaders(@RequestHeader String myHeader);

}

Expand Down

0 comments on commit 5150a9a

Please sign in to comment.