Commit Graph

3843 Commits

Author SHA1 Message Date
Sébastien Deleuze
75faf698af Refine CORS documentation for wildcard processing
This commit refines CORS wildcard processing Javadoc to
provides more details on how wildcards are handled for
Access-Control-Allow-Methods, Access-Control-Allow-Headers
and Access-Control-Expose-Headers CORS headers.

For Access-Control-Expose-Headers, it is not possible to copy
the response headers which are not available at the point
when the CorsProcessor is invoked. Since all the major browsers
seem to support wildcard including on requests with credentials,
and since this is ultimately the user-agent responsibility to
check on client-side what is authorized or not, Spring Framework
continues to support this use case.

See gh-31168
2023-09-11 18:15:07 +02:00
Sam Brannen
88c3a788f3 Update copyright headers 2023-08-21 15:12:54 +02:00
Juergen Hoeller
df066d8190 Fix accidental javadoc references to jakarta packages 2023-08-16 13:03:23 +02:00
Juergen Hoeller
340b32a3cb Polishing 2023-07-19 23:31:38 +02:00
Juergen Hoeller
a7b7466274 Polishing 2023-07-19 01:17:25 +02:00
rstoyanchev
1cd994d3a8 Encapsulate full path initialization 2023-07-11 11:45:23 +01:00
Juergen Hoeller
da814e01c7 Polishing 2023-07-04 21:52:36 +02:00
Juergen Hoeller
5d4c2846d9 Polishing 2023-07-04 16:43:29 +02:00
Juergen Hoeller
02cbee560d Polishing
(cherry picked from commit 6526e79eea)
2023-06-26 20:06:12 +02:00
Juergen Hoeller
ce97342fee Consistently use mutable ArrayList for modulesToInstall vs modules
Closes gh-30751

(cherry picked from commit 062d701ae1)
2023-06-26 12:39:01 +02:00
rstoyanchev
1c43a4c7ab Fix regression in ReactorServerHttpRequest
Instead of a backport for cef916, this change simply undoes the
optimization that led to the regression.

Closes gh-30314
2023-04-11 15:12:54 +01:00
Sébastien Deleuze
e931fdc5c2 Make HttpComponentsHeadersAdapter#getFirst nullable
Backport of gh-30267

Closes gh-30269
2023-04-03 09:06:32 +02:00
Juergen Hoeller
a93382dbbf Propagate HttpStreamResetException itself if cause is null
Closes gh-30245

(cherry picked from commit 8fca258207)
2023-03-30 19:32:29 +02:00
Sam Brannen
3ddf183922 Update copyright headers 2023-03-17 14:51:13 +01:00
rstoyanchev
f0da099b12 Prefer request hostName and hostPort in ReactorServerHttpRequest
Backport of 682a4d53 and 9624ea39

Closes gh-29974
2023-03-14 07:02:21 +00:00
rstoyanchev
a2b7a907ec Prefer local hostAddress in ReactorServerHttpRequest
Closes gh-28601
2023-02-23 16:40:38 +00:00
Johnny Lim
4c351e811a Polish
See gh-29928
2023-02-09 09:55:19 +01:00
Juergen Hoeller
42e7318cbb Polishing 2023-01-31 16:48:36 +01:00
Juergen Hoeller
000383fbff Explicit target ClassLoader for interface-based infrastructure proxies
Includes direct JDK Proxy usage instead of ProxyFactory where possible.

Closes gh-29913

(cherry picked from commit 4d6249811e)
2023-01-31 16:48:27 +01:00
Juergen Hoeller
37cbdc2cf4 Lazily load ContextLoader.properties (and lazily fail if not present)
Closes gh-29905

(cherry picked from commit a74b86e812)
2023-01-31 16:21:45 +01:00
rstoyanchev
45a7917a36 Backport of cf9fc69d6b
Closes gh-29911
2023-01-31 11:55:32 +00:00
Sam Brannen
90ea39cc6b Update copyright headers 2023-01-28 20:49:13 +01:00
Arjen Poutsma
21c3d4f4a9 Support Jetty 10 in JettyClientHttpRequest
Though Jetty 10 was previously supported in the JettyClientHttpResponse,
this commit ensures support in the JettyClientHttpRequest.

Closes gh-29867
See gh-26123
2023-01-26 17:27:57 +01:00
Sébastien Deleuze
4a4b332709 Refine Jackson2ObjectMapperBuilder#configureFeature exception handling
This commit changes the FatalBeanException previously thrown for
an IllegalArgumentException which seems more suitable for that
use case.

Closes gh-29860
2023-01-20 10:15:49 +01:00
Brian Clozel
777f01d786 Fix path within mapping when pattern contains ".*"
Prior to this commit, extracting the path within handler mapping would
result in "" if the matching path element would be a Regex and contain
".*". This could cause issues with resource handling if the handler
mapping pattern was similar to `"/folder/file.*.extension"`.

This commit introduces a new `isLiteral()` method in the `PathElement`
abstract class that expresses whether the path element can be compared
as a String for path matching or if it requires a more elaborate
matching process.

Using this method for extracting the path within handler mapping avoids
relying on wildcard count or other properties.

See gh-29712
Fixes gh-29716
2022-12-19 10:53:02 +01:00
Juergen Hoeller
937ab5f4b2 Polishing (aligned with main) 2022-12-13 12:06:09 +01:00
rstoyanchev
912fa7602a Improve invalid Content-Type handling in WebFlux
Closes gh-29565
2022-12-09 11:53:16 +00:00
Sam Brannen
41a6b7ec20 Update copyright headers for source code changed since August 2022
The changes in this commit were performed using the newly introduced
update_copyright_headers.sh script.
2022-12-03 17:23:21 -05:00
Sam Brannen
750a8b359f Stop using Mockito to spy() on JDK I/O streams
When running on JDK 16+, we are not able to spy() on JDK types. To
address this, this commit stops using Mockito to spy on JDK I/O streams
(such as ByteArrayInputStream and ByteArrayOutputStream).
2022-12-03 17:23:21 -05:00
Sam Brannen
109b00d24d Avoid use of deprecated Character/Double constructors in tests 2022-12-03 17:23:21 -05:00
Juergen Hoeller
2d94b43faa Polishing 2022-12-02 11:15:03 +01:00
Juergen Hoeller
a11222f681 Polishing 2022-11-25 17:58:59 +01:00
Juergen Hoeller
0e33537d9d Consistent use of DefaultParameterNameResolver in tests 2022-11-23 11:17:58 +01:00
rstoyanchev
09b19d7aa6 Update RestTemplate Javadoc
Closes gh-29311
2022-11-11 12:16:02 +00:00
Juergen Hoeller
d7d44c6c51 Polishing 2022-11-10 18:26:49 +01:00
Juergen Hoeller
86fbb8678a Use unquoted value in assertion message in MediaType.checkParameters()
Closes gh-29461
2022-11-10 18:24:57 +01:00
Sam Brannen
e5878ab15b Fix precondition assertions 2022-11-08 12:08:08 +01:00
Sam Brannen
5f02323b9c Avoid String allocations with Assert.isTrue() 2022-11-05 14:40:45 +01:00
Sam Brannen
deabd66939 Avoid String allocations with Assert.state() 2022-11-04 16:24:59 +01:00
Christoph Dreis
2a853aea67 Avoid String allocations in MediaType.checkParameters
Closes gh-29428
2022-11-04 16:24:59 +01:00
Sam Brannen
a281d8c3fd Polishing 2022-11-04 16:24:59 +01:00
Arjen Poutsma
46329851c1 Ensure state of PartGenerator accepts buffers
This commit makes sure that the current state of the PartGenerator
is able to handle an incoming buffer, possibly requested because of
a request coming from the subscription. All states accept new buffers
except the WritingFileState.

Closes gh-29227
2022-10-27 12:12:57 +02:00
Brian Clozel
9410998897 Add caching headers to If-Unmodified-Since responses
Conditional requests using "If-Unmodified-Since" headers are generally
used as precondition checks for state-changing methods (POST, PUT,
DELETE). See https://datatracker.ietf.org/doc/html/rfc7232#section-3.4
The spec also allows for idempotent methods like GET and HEAD.

Prior to this commit, the "If-Unmodified-Since" processing done in
`checkNotModified` (see `ServletWebRequest` and
`DefaultServerWebExchange`) would only focus on the state changing
methods and not take into account the safe methods. For those cases, the
"ETag" and "Last-Modified" would be missing from the response.

This commit ensures that such headers are added as expected in these
cases.

Fixes gh-29362
2022-10-21 15:11:08 +02:00
Johnny Lim
1c1a0afbed Use AssertJ static imports consistently in 5.3.x
Closes gh-29282
2022-10-08 13:57:21 +02:00
Brian Clozel
9465110917 Polish
See gh-26707
2022-09-26 22:25:44 +02:00
chenrl
b71e686cbd Fix ServletContextResource isFile check
Prior to this commit, `ServletContextResource` could rely on
`ServletContext#getRealPath` to check whether a resource exists.
This behavior is not enforced on some Servlet containers, as this method
is only meant to translate virtual paths to real paths, but not
necessarily check for the existence of the file.

See https://bz.apache.org/bugzilla/show_bug.cgi?id=55837#c3 for a
rationale of this behavior in Tomcat.

This commit enforces an additional check, resolving the path as a `File`
and checking that is exists and is a file.

Closes gh-26707
2022-09-26 22:20:15 +02:00
rstoyanchev
ae8b7973b4 Improve Javadoc on RequestEntity#getUrl
Closes gh-28930
2022-09-14 19:25:55 +01:00
Marc Wrobel
ce49068ff9 Fix links in Javadoc and reference docs
- Fix broken links (by using a new URL, an alternative URL, or a
  Wayback Machine link)

- Use HTTPS where possible

- Remove https://issuetracker.springsource.com/browse/EBR-349: this
  link is dead and is also mentioned in
  https://jira.spring.io/browse/SPR-8093

- Clean up nohttp allowlist.lines

Closes gh-28876
2022-09-14 17:00:11 +02:00
Marc Wrobel
92a231cf91 Fix typos in Javadoc, reference docs, and code
Closes gh-28822
2022-09-14 16:45:34 +02:00
Sam Brannen
50dff77d01 Polish contribution 2022-09-14 16:08:01 +02:00