Commit Graph

1867 Commits

Author SHA1 Message Date
Sébastien Deleuze
aabe4d0b07 Pickup CoroutineContext saved by CoWebFilter in coRouter
Closes gh-31793
2023-12-11 19:03:35 +01:00
Sébastien Deleuze
91b9a75371 Box Kotlin value class parameters in web endpoint
In order to avoid "java.lang.IllegalArgumentException:
object is not an instance of declaring class" errors.

Closes gh-31698
2023-12-08 15:27:08 +01:00
Rossen Stoyanchev
2e07f9ab33 DefaultWebClient exposes full URI template as request attribute
Closes gh-30027
2023-12-07 12:16:22 +00:00
Arjen Poutsma
ef4ffa0005 Support empty part in DefaultPartHttpMessageReader
This commit fixes a bug in DefaultPartHttpMessageReader's
MultipartParser, due to which the last token in a part window was not
properly indicated.

Closes gh-30953
2023-12-06 12:21:37 +01:00
Yanming Zhou
afcd03bddc Replace assertThat(x.isEmpty()).isTrue() with assertThat(x).isEmpty()
Search for   : assertThat\((.+).isEmpty\(\)\).isTrue\(\)
Replace with : assertThat($1).isEmpty()

Search for   : assertThat\((.+).isEmpty\(\)\).isFalse\(\)
Replace with : assertThat($1).isNotEmpty()

Closes gh-31758
2023-12-06 10:04:56 +01:00
Yanming Zhou
7b16ef90f1 Replace assertThat(x.equals(y)) with assertThat(x).isEqualTo(y)
Search for   : assertThat\((.+)\.equals\((\w+)\)\)\.isTrue\(\)
Replace with : assertThat($1).isEqualTo($2)

Search for   : assertThat\((.+)\.equals\((\w+)\)\)\.isFalse\(\)
Replace with : assertThat($1).isNotEqualTo($2)

Closes gh-31763
2023-12-06 09:50:15 +01:00
Yanming Zhou
59815cefce Replace assertThat(x.get(i)). with assertThat(x).element(i).
Search for   : assertThat\((.+)\.get\((\d+)\)\)\.
Replace with : assertThat($1).element($2).

Closes gh-31759
2023-12-06 09:43:59 +01:00
Yanming Zhou
785ad399e9 Replace assertThat(x.iterator().next()) with assertThat(x).element(0)
Search for   : assertThat\((.+).iterator\(\).next\(\)\)
Replace with : assertThat($1).element(0)
2023-12-06 10:52:39 +08:00
Arjen Poutsma
52d4b83dba Partially revert RequestPredicates attribute handling
This commit partially reverts 39786e4790
and c5c843696b, as the approach taken did
not take into account request predicates that query request attributes,
including path variables.

Closes gh-31732
2023-12-05 12:30:15 +01:00
Yanming Zhou
490b5c77fc Use switch expression where feasible 2023-12-04 15:42:55 +01:00
Sam Brannen
6ea9fdbf77 Polishing 2023-11-30 19:04:59 +01:00
Stéphane Nicoll
0785256b2f Match HandlerMapping lookup to bean signature
This commit makes sure to initialize any HandlerMapping defined in the
context when searching for resource handlers. Previously, the detection
algorithm was looking up for `SimpleUrlHandlerMapping` while the
declared target type in WebMvcConfigurationSupport is HandlerMapping.
If the application uses lazy initialization, the lookup algorithm would
not force that bean to be initialized.

Closes gh-25488
2023-11-26 09:59:12 +01:00
Sam Brannen
dbad9fd208 Update copyright headers 2023-11-25 14:59:40 +01:00
Sam Brannen
657b1c6455 Document need for -parameters flag in exception messages
Closes gh-31675
2023-11-25 14:53:56 +01:00
Stéphane Nicoll
c2745de60c Polish 2023-11-25 09:57:13 +01:00
Brian Clozel
15d9d9d06a Add current observation context in ClientRequest
Prior to this commit, `ExchangeFilterFunction` could only get the
current observation from the reactor context. This is particularly
useful when such filters want to add KeyValues to the observation
context.

This commit makes this use case easier by adding the context of the
current observation as a request attribute. This also aligns the
behavior with other instrumentations.

Fixes gh-31609
2023-11-24 17:36:15 +01:00
Sébastien Deleuze
441e210533 Treat kotlin.Unit as void in web controllers
This commit fixes a regression introduced by gh-21139
via the usage of Kotlin reflection to invoke HTTP
handler methods. It ensures that kotlin.Unit is treated
as void by returning null.

It also polishes CoroutinesUtils to have a consistent
handling compared to the regular case, and adds related
tests to prevent future regressions.

Closes gh-31648
2023-11-22 13:45:03 +01:00
Sébastien Deleuze
c329ed83ef Polish InvocableHandlerMethodKotlinTests 2023-11-22 12:40:47 +01:00
Sam Brannen
7d2ea7e7e1 Ensure PathResourceResolvers log warnings for non-existent resources
Prior to this commit, the getResource() methods in PathResourceResolver
implementations allowed an exception thrown from Resource#getURL() to
propagate instead of logging a warning about the missing resource as
intended.

This commit modifies the getResource() methods in PathResourceResolver
implementations so that the log messages include the output of the
toString() implementations of the underlying resources instead of their
getURL() implementations, which may throw an exception.

Furthermore, logging the toString() output of resources aligns with the
existing output for "allowed locations" in the same log message.

Note that the toString() implementations could potentially also throw
exceptions, but that is considered less likely.

Closes gh-31623
2023-11-20 11:48:57 +01:00
Sam Brannen
7006d0a80e Polishing 2023-11-19 14:28:19 +01:00
Stéphane Nicoll
f5453cc445 Polish 2023-11-10 16:42:43 +01:00
rstoyanchev
769128a0b2 Merge branch '6.0.x' 2023-11-09 12:53:36 +00:00
rstoyanchev
7714110940 Polishing in DefaultWebClient 2023-11-09 12:53:15 +00:00
rstoyanchev
75d1278bde Include port when logging URI in DefaultWebClient
Closes gh-30519
2023-11-09 12:53:15 +00:00
rstoyanchev
30e4a0a300 Polishing as a result of discussion under gh-31529 2023-11-02 16:18:25 +00:00
rstoyanchev
f16122d533 Polishing and minor refactoring
Closes gh-31202
2023-11-02 11:32:03 +00:00
Carl-Eric Menzel
d54a694f5a Add handler for unknown status codes
See gh-31202
2023-11-02 11:32:03 +00:00
Sam Brannen
3d248607dc Update copyright headers 2023-10-30 15:21:02 +01:00
Johnny Lim
2b750926c3 Polishing
Closes gh-31522
2023-10-30 15:05:20 +01:00
Brian Clozel
c076f44144 Allow ETag generation configuration on ResourceHandlerRegistration
This commit surfaces the ETag generation feature for both
`ResourceHttpRequestHandler` and `ResourceWebHandler` on their
respective `ResourceHandlerRegistration` for easier configuration.

See gh-29031
2023-10-25 16:02:59 +02:00
Brian Clozel
9ac5eb0f55 Support ETag generation on ResourceWebHandler
This commit replicates the ETag generation option now available on
`ResourceHttpRequestHandler` but for its WebFlux counterpart.

See gh-29031
2023-10-25 16:01:15 +02:00
Brian Clozel
ff14c5121d Refactor ResourceWebHandlerTests 2023-10-25 16:00:04 +02:00
Sébastien Deleuze
a71eb3fb08 Merge branch '6.0.x' 2023-10-24 17:56:06 +02:00
Sébastien Deleuze
7874a59771 Remove invalid domain integration tests
Closes gh-31119
2023-10-24 17:54:39 +02:00
Stéphane Nicoll
ef47eef92a Merge branch '6.0.x' 2023-10-24 10:57:09 +02:00
Stéphane Nicoll
9aa707ec4b Polish "Return consistent collection type for matrix variables"
See gh-31483
2023-10-24 10:55:42 +02:00
Sam Brannen
2d792f000a Polish "Apply SingleSpaceSeparator Checkstyle module"
See gh-31469
2023-10-22 14:18:18 +02:00
Johnny Lim
64e9fcad53 Apply SingleSpaceSeparator Checkstyle module
This commit also fixes its violations.

Closes gh-31469
2023-10-22 14:09:57 +02:00
Sam Brannen
37e6fe5b64 Update copyright headers 2023-10-22 11:28:40 +02:00
rstoyanchev
a2f2f7c348 Use correct RequestParam resolver
Closes gh-31329
2023-10-20 12:39:50 +01:00
Sébastien Deleuze
c6b86af78b Fall back on UTF-8 charset in WebClientResponseException
Instead of ISO-8859-1, consistently with the change done
in RestClientResponseException.

Closes gh-31072
2023-10-19 12:59:12 +02:00
rstoyanchev
a53d3f3cea Apply DisconnectedClientHelper to @ExceptionHandler methods
Use the helper to reduce logging when an @ExceptionHandler fails
to write to the response due to a network failure where the client
has gone away.

Closes gh-26181
2023-10-17 15:52:24 +01:00
Johnny Lim
919faa2ce2 Order modifiers to align with JLS
This commit also applies Checkstyle ModifierOrder to enforce it.

See gh-31368
2023-10-17 16:13:56 +02:00
Sam Brannen
32b4f55d92 Update copyright headers 2023-10-16 16:19:55 +02:00
rstoyanchev
b5b9386be6 Polishing
Closes gh-31413
2023-10-13 11:47:47 +01:00
Olga MaciaszekSharma
0cd196e3dd Add UriBuilderFactoryArgumentResolver
See gh-31413
2023-10-13 11:47:47 +01:00
Sébastien Deleuze
e0ba42a80c Move ReactorResourceFactory to org.springframework.http.client package
Closes gh-31399
2023-10-10 15:58:20 +02:00
Arjen Poutsma
307a2c7d7b Polishing external contribution
See gh-29985
2023-10-10 14:16:00 +02:00
Jakob Fels
ad50de169c Provide access to HTTP headers in resource routing
This commit adds additional overloaded methods that allow for HTTP
header manipulation of served resources.

Closes gh-29985
2023-10-10 14:16:00 +02:00
Arjen Poutsma
59d123a18e Introduce OutputStream BodyInserter
This commit introduces a BodyInserter that inssert any bytes written to
an output stream to the body of an output message.

Closes gh-31184
2023-10-05 15:31:08 +02:00