Commit Graph

4702 Commits

Author SHA1 Message Date
rstoyanchev ba4d459f81 Merge branch '6.0.x' 2023-11-08 11:47:18 +00:00
rstoyanchev 5c012bbb0c Set maxAge correctly when expiring WebSession
Closes gh-31214
2023-11-08 11:44:36 +00:00
Stéphane Nicoll d34b3c1a71 Merge branch '6.0.x' 2023-11-08 08:04:27 +01:00
Johnny Lim cafb38ad1d Add Javadoc since to ProblemDetail.setProperties()
See gh-31571
2023-11-08 08:02:57 +01:00
Arjen Poutsma 5afb00d270 Merge branch '6.0.x' 2023-11-07 15:10:59 +01:00
Arjen Poutsma dc26d3b0ec Defer cleanup in DefaultServerWebExchange
This commit ensures that the multipartRead flag is read in a deferred
block, and is not evaluated too early.

Closes gh-31567
2023-11-07 15:00:20 +01:00
Arjen Poutsma 486503bd31 Buffer writes in JettyClientHttpRequest
This commit ensures that not every OutputStream.write gets written as a
separate chunk, by buffering the written data in a BufferedOutputStream.
In some cases, a large quantity of small writes would result in many
sent chunks.

Closes gh-31361
2023-11-07 14:02:01 +01:00
Arjen Poutsma 0839f5b749 Test form submissions
See gh-31361
2023-11-07 12:27:31 +01:00
rstoyanchev 5df6e8825d Polishing in CookieWebSessionIdResolver
See gh-31214
2023-11-06 11:31:39 +00:00
Arjen Poutsma efb93ca109 Fix bug in calculation of maximum form part size
See gh-31343
2023-11-06 11:20:18 +01:00
rstoyanchev 654e822676 Fix Javadoc link 2023-11-03 14:38:53 +00:00
Arjen Poutsma 6dd93d4d85 Allow repeatable writes in HttpMessageConverter
This commit ensures that the StreamingHttpOutputMessage.Body.repeatable
flag is set in message converters for bodies that can be written
repeatedly.

Closes gh-31516
See gh-31449
2023-11-02 15:51:36 +01: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
Johnny Lim 2b750926c3 Polishing
Closes gh-31522
2023-10-30 15:05:20 +01:00
Arjen Poutsma 66aac7e359 Add maxParts and maxPartSize to PartEventHttpMessageReader
This commit introduces the maxParts and maxPartSize properties to
PartEventHttpMessageReader, which can be used to limit the amount of
parts, and maximum part size respectively.

Closes gh-31343
2023-10-25 15:18:35 +02:00
Rob Winch 03d286c4a1 Document X-Forwarded-* Headers
Previously the documentation assumed that the readers knew how to use
the X-Forwarded-* headers. This commit documents details & examples
of how to use the X-Forwarded-* headers.

See gh-31491
2023-10-25 13:22:41 +01:00
Sébastien Deleuze 3b80f2c4cb Refine MaxUploadSizeExceededException handling
This commit refines MaxUploadSizeExceededException
handling in order to translate to a "413 Payload Too Large"
status code instead of "500 Internal Server Error", with
related ProblemDetail body.

Closes gh-27170
2023-10-25 12:11:53 +02:00
Sébastien Deleuze a71eb3fb08 Merge branch '6.0.x' 2023-10-24 17:56:06 +02:00
Arjen Poutsma b6e0b8c343 Use StreamingHttpOutputMessage.Body.repeatable in OkHttp3ClientHttpRequest
See gh-31449
2023-10-24 16:12:26 +02:00
rstoyanchev 3f8bbdb116 Merge branch '6.0.x' 2023-10-24 12:53:55 +01:00
rstoyanchev 5c6b9be3a1 Send 400 for PathVariable that is null after conversion
This implies a value was actually sent, but is not something
that can be converted to the expected type.

Closes gh-31382
2023-10-24 12:53:25 +01:00
rstoyanchev 796080abb8 Test for change to add conversion of defaultValue
This commit adds a test and polishing for a change in
AbstractNamedValueMethodArgumentResolver erroneously committed
with (unrelated) commit e57b942b.

If an argument becomes null after conversion and a default value is
applied, that default value should also pass through conversion.

Closes gh-31336
2023-10-24 12:24:03 +01:00
Arjen Poutsma e0ac000415 Allow repeatable writes in StreamingHttpOutputMessage
This commit adds a repeatable property to
StreamingHttpOutputMessage.Body, indicating that the body can be written
 multiple times. In HttpComponentsClientHttpRequest, this property is
 exposed via org.apache.hc.core5.http.HttpEntity.isRepeatable, to allow
 for redirects.

Closes gh-31449
2023-10-24 12:11:13 +02:00
rstoyanchev e57b942b4d MockMvcBuilder supports filter name in addition to initParams
Closes gh-31474
2023-10-24 10:33:58 +01:00
Arjen Poutsma cb4d44b83e JdkClientHttpRequest does not support Content-Length 0
This commit ensures the correct HttpRequest.BodyPublisher is used with
Content-Length 0.

Closes gh-31451
2023-10-23 12:25:10 +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
Brian Clozel 31a62ff8ba Add JMH benchmarks for Protobuf message converter
This commit re-generates the protobuf Java classes with a recent version
of the protoc binary and adds JMH benchmarks that exercise the message
converter for both the reading and writing cases.

See gh-29496
2023-10-20 16:35:21 +02:00
Brian Clozel 631a5d1dc1 Remove support for Protobuf 2.x and protobuf-java-format
Closes gh-31465
2023-10-20 15:05:02 +02:00
rstoyanchev 7271dfed68 Use CopyOnWriteArrayList for beforeCommit actions
Closes gh-27587
2023-10-20 13:21:09 +01:00
rstoyanchev a8019f2d0b Create reusable DisconnectedClientHelper
See gh-26181
2023-10-17 15:52:24 +01:00
Stéphane Nicoll 5c6232e681 Polish "Order modifiers to align with JLS"
See gh-31368
2023-10-17 16:16:58 +02: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
Sébastien Deleuze 669c723ae0 Merge branch '6.0.x' 2023-10-17 14:25:33 +02:00
Sébastien Deleuze 875eeabb6f Add a properties setter to ProblemDetail
Mainly to allow Kotlin idiomatic properties assignment.

Closes gh-31430
2023-10-17 14:11:24 +02:00
Stéphane Nicoll 6efc99fdd8 Harmonize BeanRegistrationAotContribution class names 2023-10-17 12:37:52 +02:00
Sam Brannen 32b4f55d92 Update copyright headers 2023-10-16 16:19:55 +02:00
Sam Brannen d43cf2c5cd Polishing 2023-10-13 18:12:49 +02:00
Brian Clozel ca4d0d784b Apply instrumentation fixes to HttpWebHandlerAdapter
Since the Spring WebFlux HTTP server instrumentation has been moved from
the `WebFilter` to the `HttpWebHandlerAdapter`, we need to apply similar
changes there.

See gh-31417
2023-10-13 15:04:03 +02:00
Brian Clozel 579f29857f Merge branch '6.0.x' 2023-10-13 15:03:56 +02:00
Brian Clozel da95542d8f Prevent duplicate HTTP server observations
Prior to this commit, HTTP server observations for Spring WebFlux could
be recorded twice for a single request in some cases. The "COMPLETE" and
"CANCEL" signals would race in the reactive pipeline and would trigger
both the `doOnComplete()` and ` `doOnCancel()` operators, each calling
`observation.stop()` on the current observation.
This would in fact publish two different observations for the same
request.

This commit ensures that the instrumentation uses the `Mono#tap`
operator to guard against this case and only call `Observation#stop`
once for each request.

Fixes gh-31417
2023-10-13 14:56:40 +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
rstoyanchev 0542fe5232 Update ClientHttpRequestInterceptor javadoc
Clarify the interceptor is responsible for closing the response
if it throws an exception after receiving it.

Closes gh-29751
2023-10-11 17:09:18 +01:00
Brian Clozel d1cf71cc70 Merge branch '6.0.x' 2023-10-11 11:24:00 +02:00
Brian Clozel e9fcb21d55 Refine status KeyValue for HTTP server observations
Prior to this commit, a cancelled exchange would always result in an
`"status":"UNKNOWN"` KeyValue. This only applied to reactive variants,
as cancelled exchanges are not currently detected for Servlet
implementations.

In some cases, exchanges can be cancelled by clients before they are
completed, but the response was actually received by the client. The
response status information has been set by the application and the
response has been committed. For those cases, we shouldn't assume an
"UNKNOWN" value.

This commit assumes that committed responses have a response status set
by the application and that the observations should reflect that. From
now on, we only assume an "UNKNOWN" status if the response has not been
commited.

Fixes gh-31388
2023-10-11 11:17:38 +02:00
Sébastien Deleuze 2158410853 Revert "Support Jackson's DatatypeFeature in Jackson2ObjectMapperBuilder"
This reverts commit 5f053401e2.
2023-10-11 10:10:36 +02:00
Sébastien Deleuze ae88bbaac3 Reintroduce org.springframework.http.client.reactive.ReactorResourceFactory
This commit reintroduces a deprecated ReactorResourceFactory in
org.springframework.http.client.reactive package that extends
the one in org.springframework.http.client package to avoid an
API breaking change and to provide a smoother upgrade experience.

Closes gh-31399
2023-10-11 08:38:17 +02:00