Commit Graph

2344 Commits

Author SHA1 Message Date
Sam Brannen
f5c3f3522e Simplify @⁠EnumSource usage 2024-11-18 14:12:13 +01:00
Brian Clozel
5b5a072351 Merge branch '6.1.x' 2024-11-12 10:05:24 +01:00
Brian Clozel
49a63e2c37 Add tests for gh-33867
Closes gh-33867
2024-11-12 10:02:48 +01:00
rstoyanchev
d4719493bd Empty string check after conversion in AbstractNamedValueArgumentResolver
Closes gh-33794
2024-11-08 09:21:08 +00:00
Simon Baslé
bbe90a57ba Merge branch '6.1.x' 2024-11-06 11:40:46 +01:00
Simon Baslé
9b3cb15389 Introduce HttpHeaders#headerSet to guarantee case-insensitive iteration
The `HttpHeaders#headerSet` method is intended as a drop-in replacement
for `entrySet` that guarantees a single casing for all header names
reported during the iteration, as the cost of some overhead but with
support for iterator removal and entry value-setting.

The `formatHeaders` static method is also altered to do a similar
deduplication of casing variants, but now additionally mentions
"with native header names [native name set]" if the native name set
contains casing variants.

Closes gh-33823
2024-11-06 11:11:39 +01:00
rstoyanchev
bc65f93467 Improve cancel in SubscriberInputStreamTests 2024-10-31 10:05:45 +00:00
rstoyanchev
38c88e769d Polishing in SubscriberInputStreamTests 2024-10-31 10:05:45 +00:00
rstoyanchev
f1cfe7a3d4 InputStreamSubscriber instantiation and Javadoc
See gh-31677
2024-10-28 12:45:53 +00:00
rstoyanchev
dfaf7a0c6a Rename InputStreamSubscriber to SubscriberInputStream
It is both, but InputStream is what's exposed for public use,
in effect an InputStream backed by a Subscriber source.

See gh-31677
2024-10-28 12:45:53 +00:00
rstoyanchev
86a42db002 InputStreamSubscriber/Tests conform to style
See gh-31677
2024-10-28 12:45:53 +00:00
rstoyanchev
d4b31fd4b2 InputStreamSubscriber compiler issues
See gh-31677
2024-10-28 12:45:53 +00:00
OlegDokuka
37622a7f90 Support Publisher to InputStream conversion
See gh-31677
2024-10-28 12:45:53 +00:00
Sam Brannen
5532574f56 Remove unused casts and variables 2024-10-25 15:16:05 +02:00
Brian Clozel
9df4fcdc9e Merge branch '6.1.x' 2024-10-25 10:55:00 +02:00
Brian Clozel
a06bbccf9e HttpHeaders.writeableHttpHeaders should unwrap many times
Prior to this commit, the `HttpHeaders.writeableHttpHeaders` would only
consider headers read-only instances that were wrapped once by
`HttpHeaders.readOnlyHttpHeaders`. This does not work when other
`HttpHeaders` wrappers are involved in the chain.

This commit ensures that `writeableHttpHeaders` unwraps all headers
instances down to the actual multivalue map and create a new headers
instance out of it.

Fixes gh-33789
2024-10-25 10:22:12 +02:00
rstoyanchev
d05f880d74 Fix test causing failure in RestClientObservationTests
See gh-33697
2024-10-23 12:24:28 +01:00
rstoyanchev
73e5aa38ec Polishing contribution
See gh-33697
2024-10-23 11:38:19 +01:00
Nicklas Wiegandt
a0af708c03 Add cookie support to RestClient
See gh-33697
2024-10-23 11:38:18 +01:00
rstoyanchev
b7fc4bc5c8 Polishing contribution
Closes gh-33716
2024-10-22 17:37:45 +01:00
Ilya Serkov
657e002ed7 Fix HttpHeaders.setHost() to remove the header
See gh-33716
2024-10-22 17:37:44 +01:00
Brian Clozel
5f14703105 Merge branch '6.1.x' 2024-10-18 14:43:54 +02:00
Brian Clozel
67d78eb61c Avoid Servlet observations failures for invalid HTTP status
Prior to this commit, the `DefaultServerRequestObservationConvention`
for Servlet failed when the HTTP response status was invalid (for
example, set to "0").

This commit catches `IllegalArgumentException` thrown for such invalid
HTTP status and instead returns an unknown outcome for the observation.

Fixes gh-33725
2024-10-18 14:43:46 +02:00
Brian Clozel
cee8b52de8 Merge branch '6.1.x' 2024-10-18 10:55:21 +02:00
Brian Clozel
912c067e23 Fix buffer leak in Jackson2 decoders
Prior to this commit, the Jackson2 decoders (JSON, Smile, CBOR) could
leak buffers in case the decoding operation times out or is cancelled
and some buffers are still in flight.

This commit ensures that buffers are released on cancel signals.

Fixes gh-33731
2024-10-18 10:51:38 +02:00
rstoyanchev
ca820c914f Polishing contribution
Closes gh-33715
2024-10-16 13:06:22 +01:00
Yanming Zhou
f35ed8d044 Improve check whether to lowercase scheme
See gh-33715

```
Map has no value for 'thescheme'
java.lang.IllegalArgumentException: Map has no value for 'thescheme'
	at org.springframework.web.util.UriComponents$MapTemplateVariables.getValue(UriComponents.java:348)
	at org.springframework.web.util.UriComponents.expandUriComponent(UriComponents.java:263)
	at org.springframework.web.util.HierarchicalUriComponents.expandInternal(HierarchicalUriComponents.java:436)
	at org.springframework.web.util.HierarchicalUriComponents.expandInternal(HierarchicalUriComponents.java:53)
	at org.springframework.web.util.UriComponents.expand(UriComponents.java:161)
	at org.springframework.web.util.UriComponentsBuilder.buildAndExpand(UriComponentsBuilder.java:364)
```
2024-10-16 12:54:33 +01:00
rstoyanchev
bdcfbee7df Merge branch '6.1.x' 2024-10-16 12:11:23 +01:00
rstoyanchev
23656aebc6 Use Locale.ROOT consistently for toLower/toUpperCase
See gh-33708
2024-10-16 12:05:54 +01:00
rstoyanchev
c261ca3102 Ensure scheme not lowercased if URI variable
Closes gh-33699
2024-10-15 20:50:01 +01:00
Simon Baslé
12134e8619 Merge branch '6.1.x' 2024-10-14 11:57:39 +02:00
Simon Baslé
8da31e1db7 Reject CORS request with 403 if Origin header is malformed
When assessing if a request is a CORS request, both mvc and reactive
`DefaultCorsProcessor` now catch `IllegalArgumentException` and turn
this into a 403 rejection rather than letting the exception propagate
into a 500 response.

Closes gh-33688
2024-10-14 11:50:19 +02:00
rstoyanchev
f4967f202e Revise URI template handling in WhatWgUrlParser
Closes gh-33673
2024-10-09 13:29:49 +01:00
rstoyanchev
1f4743af54 Lenient handling of malformed query in ServletServerHttpRequest
Closes gh-30489
2024-10-09 13:29:49 +01:00
Simon Baslé
ef77b4064f Keep DefaultServerHttpRequestBuilder-mutated headers case-insensitive
This change avoids the trap of creating a copy of `HttpHeaders` using a
case-sensitive `MultiValueMap` by mistake. Since mutability is always
desirable, we make a mutable copy by using `addAll` on an empty
`HttpHeaders`.

We can't simply rely on HttpHeaders' map-based constructor to detect
read-only header in this particular case, because the container's
original headers representation might in some cases be read-only.

Closes gh-33666
2024-10-09 11:39:33 +02:00
rstoyanchev
a84a41fa43 Polishing contribution
Closes gh-33638
2024-10-08 10:56:42 +01:00
Dariusz Jędrzejczyk
a78385f8e5 Handle X-Forwarded-Prefix parsed by Reactor Netty
See gh-33638
2024-10-08 10:56:42 +01:00
rstoyanchev
2389748e25 Parameterize URI parsing tests
Closes gh-33639
2024-10-07 18:35:03 +01:00
rstoyanchev
bbb53d03c4 Pluggable URI parsing, use RFC parser by default
See gh-33639
2024-10-07 18:35:03 +01:00
rstoyanchev
10f45223aa Rename UrlParser to WhatWgUrlParser
See gh-33639
2024-10-07 18:35:03 +01:00
rstoyanchev
e04b115a7e Remove test for IPv4 compatible IPv6 address
An example of this can be found in RFC 2732, but it is obsoleted by
RFC 3986 whose syntax for IPv6address does not allow dots.

Also, Appendix D of RFC 3986:

As [RFC2732] defers to [RFC3513] for definition of an IPv6 literal
address, which, unfortunately, lacks an ABNF description of
IPv6address, we created a new ABNF rule for IPv6address that matches
the text representations defined by Section 2.2 of [RFC3513].

See gh-33639
2024-10-07 18:35:03 +01:00
Simon Baslé
6c5e63e446 Merge branch '6.1.x' 2024-10-03 16:33:40 +02:00
Simon Baslé
b54420f8aa Include argument name in MethodArgumentTypeMismatchException message
Closes gh-33573
2024-10-03 16:32:29 +02:00
Juergen Hoeller
b59d0a396e Add equals/hashCode methods to ServerSentEvent
Closes gh-33606
2024-09-30 11:22:43 +02:00
Yanming Zhou
8941e2876e Replace 'e.g.' with 'for example' in documentation and comments
Closes gh-33515
2024-09-26 14:11:17 +02:00
rstoyanchev
f6c31bb6c3 Align OutputStreamPublisher's
Update constructors to match and drop unnecessary factory methods.

See gh-33592
2024-09-25 11:42:26 +01:00
Sam Brannen
f6fcf15745 Merge branch '6.1.x' 2024-09-24 12:33:58 +02:00
Sam Brannen
af3a26ab06 Clean up warnings in Gradle build 2024-09-24 12:33:35 +02:00
Sam Brannen
8931b75b95 Polishing 2024-09-20 10:58:37 +02:00
Johnny Lim
3ba9d35e22 Polish
Closes gh-33566
2024-09-20 10:58:37 +02:00