Commit Graph

3053 Commits

Author SHA1 Message Date
izeye
090e394fb5 Clean up @SuppressWarnings("ConstantConditions") 2021-06-08 13:47:00 +02:00
Sébastien Deleuze
6251222a23 Remove jackson-module-kotlin warning
Closes gh-26962
2021-06-08 11:44:03 +02:00
Brian Clozel
05eca05671 Close resources in HttpComponents client connector
Prior to this commit, the `HttpComponentsClientHttpConnector`
implementation could accept or create a default `HttpClient` instance
but not expose it as part of its API. This effectively prevents
applications from properly closing the associated resources when
disposing of the connector.

This commit implements the `Closeable` interface on the connector to
allow this use case.

Closes gh-27032
2021-06-08 11:22:30 +02:00
izeye
3fa4e4168d Remove redundant Collections.unmodifiableList() 2021-06-08 10:39:23 +02:00
Sam Brannen
ad63a534cb Polish @CookieValue Javadoc 2021-06-04 15:14:42 +02:00
Rossen Stoyanchev
821ecb4cfd Update Javadoc for CookieValue
See gh-26989
2021-06-02 17:28:28 +01:00
Rossen Stoyanchev
1c17305d7b Check for null in allowedOrigin list
Closes gh-26987
2021-06-02 17:14:28 +01:00
Arjen Poutsma
5cbbbed377 Use given name in MultipartBodyBuilder::part
Make sure that we use the parameter name in MultipartBodyBuilder::part
when adding a Part, instead of using the name specified in the
'Content-Disposition' header that might have been in the part's headers.

Closes gh-27007
2021-05-31 15:17:12 +02:00
Stephane Nicoll
4049951c03 Update copyright year of changed file
See gh-26973
2021-05-26 08:50:15 +02:00
Dillon Regimbal
89441ea006 Fix typo
See gh-26973
2021-05-26 08:49:48 +02:00
Rossen Stoyanchev
de1ba79c55 Switch to non-blocking thread after WebSession creation
See gh-26958
2021-05-24 16:27:56 +01:00
Sam Brannen
746b1b2fe1 Polishing 2021-05-23 18:27:31 +02:00
izeye
ab2c78a9d5 Fix broken Javadoc tags
Closes gh-26967
2021-05-23 18:09:34 +02:00
izeye
f65cbe0992 Polish PORT_PATTERN in UriComponentsBuilder 2021-05-20 18:20:57 +01:00
Johnny Lim
a2e5d9a14f Polishing
Closes gh-26960
2021-05-20 15:49:13 +02:00
Christoph Dreis
360f555e77 Introduce ResponseEntity.internalServerError()
Closes gh-26952
2021-05-18 16:57:20 +02:00
Rossen Stoyanchev
101ed17b6f Polishing contribution
Closes gh-26927
2021-05-17 17:28:16 +01:00
Ruslan Akhundov
66588bae92 CorsConfiguration supports port pattern and port lists
See gh-26927
2021-05-17 17:28:16 +01:00
Sam Brannen
fae484855b Fix grammar in inline comment in HttpStatus
See gh-26842
2021-05-13 16:21:45 +02:00
Sam Brannen
e31a4c4c77 Polishing 2021-05-12 11:31:15 +02:00
Arjen Poutsma
0d0d75e253 Ensure DefaultPartHttpMessageReader temp directories do not collide
This commit makes sure that the DefaultPartHttpMessageReader uses a
random temporary directory to store uploaded files, so that two
instances do not collide.

See gh-26931
2021-05-11 21:12:50 +02:00
Arjen Poutsma
cce60c479c Ensure Synchronoss temp directories do not collide
This commit makes sure that Synchronoss uses a random temporary
directory to store uploaded files, so that two instances do not collide.

Closes gh-26931
2021-05-11 21:12:50 +02:00
Juergen Hoeller
46b7cd54a1 Log missing web application context at warn level (instead of debug)
Closes gh-26925
2021-05-11 15:45:36 +02:00
Rossen Stoyanchev
aa51ed1940 Fix failing tests
This commit ensures that if an Origin is returned as it was provided,
possibly with a trailing slash.

See gh-26892
2021-05-10 14:15:16 +01:00
Rossen Stoyanchev
dc4e053d59 CorsConfiguration ignores trailing "/" in pattern
Recent commit dddcc5e9ad ensured a
trailing "/" in the Origin header has no effect. This commit does the
same for a trailing "/" in configured patterns.

See gh-26892
2021-05-10 13:30:02 +01:00
Rossen Stoyanchev
0468ef46ac Follow-up fix for recent change to PORT_PATTERN
The pattern was changed in 65797d04f2
to check for characters up until "/", instead of for digits, but now
also checks up until "?" and "#".

Closes gh-26905
2021-05-10 07:19:17 +01:00
Sam Brannen
355d394d7f Polish contribution
See gh-25200
2021-05-08 19:40:13 +02:00
Vlad Kisel
9ddab9e69b Support single-value request param resolution for data class constructors
Prior to this commit, when Web MVC attempted to resolve a constructor
argument for a data class constructor with @ModelAttribute binding,
ModelAttributeMethodProcessor failed to unwrap the array returned by
WebRequest.getParameter(String).

According to the Javadoc for WebRequest.getParameter(String), "a
single-value parameter will be exposed as an array with a single
element."

This commit fixes this issue by extracting the single value from such
an array and using that as the constructor argument (potentially
converted by the WebDataBinder).

Closes gh-25200
2021-05-08 19:25:54 +02:00
Jeon Ilwoong
65797d04f2 UriComponentsBuilder handles invalid port correctly
See gh-26905
2021-05-07 17:15:16 +01:00
Rossen Stoyanchev
5811212a9f Add PreFlightRequestWebFilter
Closes gh-26885
2021-05-07 16:48:15 +01:00
Rossen Stoyanchev
dddcc5e9ad Ignore trailing slash in Origin header
See gh-26892
2021-05-07 14:56:56 +01:00
Rossen Stoyanchev
443c34cc90 CorsRegistry implements combine correctly
Closes gh-26877
2021-05-05 21:02:25 +01:00
Rossen Stoyanchev
b76e0c4826 HttpMethod#matches compares by String equality
Closes gh-26834
2021-05-04 12:09:35 +01:00
Rossen Stoyanchev
21c90829df Polishing
See gh-26834
2021-05-04 10:34:56 +01:00
Sam Brannen
5667d459a7 Polish Javadoc 2021-05-03 15:22:43 +02:00
Rossen Stoyanchev
f7fc36250e Properly handle completion while in READING state
Closes gh-26834
2021-04-29 22:09:33 +01:00
Arjen Poutsma
7f1062159e Copy HttpStatus::values to prevent allocation
Before this commit, HttpStatus::resolve used the values() method in its
logic. This causes a new array to be allocated for each invocation,
and results in memory overhead.

This commit makes a copy of the HttpStatus values array, and uses that
to resolve status codes.

Closes gh-26842
2021-04-22 15:39:03 +02:00
Christoph Dreis
e7cbe23771 Avoid exceptions when evaluating validation hints
Prior to this commit, evaluating validation hints for
@javax.validation.Valid caused exceptions being raised when getting the
value of this annotation, which does not exist. Bypassing
AnnotationUtils.getValue() in those cases can improve performance by
avoiding the cost incurred by raising exceptions.

See gh-26787
2021-04-22 11:19:30 +02:00
Juergen Hoeller
f31933e67e Nullability refinements 2021-04-13 12:26:52 +02:00
Juergen Hoeller
c7989c78c8 Polishing 2021-04-13 12:26:31 +02:00
Arjen Poutsma
327e761536 Recreate file storage directory when removed in DefaultPartHttpMessageReader
Some operating systems delete temp files not just when booting up, but
also during operation. This commit makes sure that the
DefaultPartHttpMessageReader recreates the directory used to store
files in, if it's not there.

Closes gh-26790
2021-04-12 16:27:10 +02:00
Arjen Poutsma
a2d91a562d Support "Accept-Patch" for unsupported media type
This commit introduces support in both servlet and webflux for the
"Accept-Patch" header, which is sent when the client sends unsupported
data in PATCH requests.
See  section 2.2 of RFC 5789.

Closes gh-26759
2021-04-08 14:46:59 +02:00
Arjen Poutsma
97f3846971 Support "Accept-Patch" for OPTIONS requests
This commit introduces support in both servlet and webflux for the
"Accept-Patch" header in OPTIONS requests, as defined in section 3.1 of
RFC 5789.

See gh-26759
2021-04-08 14:43:49 +02:00
Rossen Stoyanchev
c5ac8e8ab6 Use createUnresolved for forwarded header address
Avoid DNS resolution.

See gh-26748
2021-04-07 12:50:07 +01:00
Rossen Stoyanchev
8a1182a678 Additional validation for forwarded header address value
Closes gh-26748
2021-04-06 19:43:13 +01:00
Rossen Stoyanchev
7dc3a55648 Deferred buffer allocation in SSE message writer
See gh-26746
2021-03-31 11:47:22 +01:00
Arjen Poutsma
d83fb09914 Change header encoding to UTF8 in DefaultPartHttpMessageReader
This commit changes the encoding used to parse multipart headers from
ISO-8859-1 to UTF-8, in accordance with RFC 7578.

Closes gh-26736
2021-03-30 10:51:19 +02:00
Rossen Stoyanchev
1a9556925d missingAfterConversion flag for missing request values
Closes gh-26679
2021-03-29 15:23:29 +01:00
Rossen Stoyanchev
41d5048280 Add BlockHoundIntegration for spring-web
Closes gh-26712
2021-03-22 21:18:48 +00:00
MaengSol
2728a9b931 Polishing
Closes gh-26675
2021-03-15 12:02:40 +01:00