Commit Graph

1763 Commits

Author SHA1 Message Date
Sam Brannen
9e1d0057bc Merge branch '5.3.x' 2022-05-25 11:30:42 +02:00
Sam Brannen
a221835558 Throw IllegalStateException for invalid port in HierarchicalUriComponents
Prior to this commit, getPort() in HierarchicalUriComponents threw a
NumberFormatException for an invalid port supplied as a String, which
was inconsistent with exception handling elsewhere in the class as well
as within the same method.

This commit introduces a try-catch block in getPort() to consistently
throw IllegalStateExceptions for ports that cannot be parsed.

Closes gh-28521
2022-05-25 11:29:12 +02:00
Sam Brannen
aa06a09dee Polishing 2022-05-25 11:29:12 +02:00
rstoyanchev
ff890bc1cc Support custom HTTP method for @HttpExchange
Closes gh-28504
2022-05-24 09:27:35 +01:00
rstoyanchev
48c1746693 Refactor HttpServiceProxyFactory for use as a bean
Closes gh-28505
2022-05-24 09:27:17 +01:00
rstoyanchev
2a2fba6a37 Resolve placeholders in HttpExchange#url
Closes gh-28492
2022-05-23 11:06:14 +01:00
rstoyanchev
ce568468ae Refine JSON encoding of non-streaming Flux
Closes gh-28398
2022-05-23 11:06:14 +01:00
rstoyanchev
496c1dcae1 Add RequestAttributeArgumentResolver
Closes gh-28458
2022-05-23 11:06:14 +01:00
rstoyanchev
495507e5d4 AbstractNamedValueArgumentResolver supports Object values
See gh-28458
2022-05-23 11:06:14 +01:00
wonwoo
9181ac70f5 Correctly detect Optional return type for @HttpExchange methods
Prior to this commit, a ClassCastException was thrown for an Optional
return type for an @HttpExchange method. This is because the check for
an Optional return type was based on the type contained in the Optional
instead of the Optional itself.

Closes gh-28493
2022-05-20 11:25:31 +02:00
Arjen Poutsma
e29bc3db7c Refactor PartGenerator to use isLast
This commit refactors the PartGenerator to use the newly introduced
Token::isLast property.

See gh-28006
2022-05-10 13:16:37 +02:00
rstoyanchev
64795664b2 Add ClientHttpResponseDecorator
See gh-28190
2022-05-10 11:48:46 +01:00
rstoyanchev
5d0f49c2c8 Add WebInputException subclasses
Closes gh-28142
2022-05-09 09:52:15 +01:00
Sam Brannen
365a18c9c2 Polishing 2022-05-03 15:46:07 +02:00
rstoyanchev
2d2726b8f7 Add RequestBody resolver and minor improvements
Support for RequestBody arguments.
List supported arguments on HttpExchange.
Improve null handling.

See gh-28386
2022-05-03 12:42:37 +01:00
rstoyanchev
7797453f28 Refactor resolver tests
Extract NamedValueArgumentResolverTests.
Move form data vs query params tests into HttpRequestValues.

See gh-28386
2022-05-03 12:42:37 +01:00
rstoyanchev
2794553d2e Add resolvers for URI, cookies, and request params
See gh-28386
2022-05-03 12:42:37 +01:00
rstoyanchev
f8ac5985bd Extract base class AbstractNamedValueArgumentResolver
Closes gh-28395
2022-05-03 12:42:37 +01:00
rstoyanchev
d91b840d0e Polishing and refactoring
See gh-28395
2022-05-03 12:42:37 +01:00
Olga Maciaszek-Sharma
38bf0776a1 Add initial RequestHeaderArgumentResolver implementation and tests. 2022-05-03 12:42:37 +01:00
Arjen Poutsma
efafccde2b Polish contribution & Support multiple quoted printable segments in Content-Disposition
This commit polishes the contribution for support of multiple
base64 segments, and adds supports for multiple quoted printable
segments in Content-Disposition.

Closes gh-28236
2022-04-29 12:38:42 +02:00
Alex Lei
195b622411 Support multiple base64 segments in Content-Disposition
See gh-28236
2022-04-29 12:36:42 +02:00
Arjen Poutsma
217117ced0 Remove Jakarta Mail dependency from spring-web
This commit removes the dependency that the spring-web module has on
Jakarta Mail.

In FormHttpMessageConverter, a dependency on
jakarta.mail.internet.MimeUtility was replaced by existing encoding
logic in ContentDisposition.

In StandardMultipartHttpServletRequest, a dependency on the same
MimeUtility was replaced by new quoted-printable decoding logic in
ContentDisposition.

Closes gh-28392
2022-04-28 15:39:52 +02:00
rstoyanchev
b1384ddafa Add HttpServiceProxyFactory builder
See gh-28386
2022-04-27 21:21:43 +01:00
rstoyanchev
d7ab5b4132 Refactor HttpRequestSpec to HttpRequestValues
HttpRequestValues is immutable and exposes a builder.

See gh-28386
2022-04-27 21:21:43 +01:00
rstoyanchev
564f8ba7a0 Update after review
See gh-28386
2022-04-27 21:21:43 +01:00
rstoyanchev
bb44c0e13a Polishing
See gh-28386
2022-04-27 21:21:43 +01:00
rstoyanchev
4bddbd30c4 Polishing contribution
See gh-28386
2022-04-27 21:21:43 +01:00
Olga Maciaszek-Sharma
c2a008fc22 Add HttpMethod and PathVariable argument resolvers
See gh-28386
2022-04-27 21:21:43 +01:00
rstoyanchev
c418768f05 Add @HttpRequest and HttpServiceProxyFactory
See gh-28386
2022-04-27 21:21:43 +01:00
Arjen Poutsma
be7fa3aaa8 Introduce PartEvent
This commit introduces the PartEvent API. PartEvents are either
- FormPartEvents, representing a form field, or
- FilePartEvents, representing a file upload.

The PartEventHttpMessageReader is a HttpMessageReader that splits
multipart data into a stream of PartEvents. Form fields generate one
FormPartEvent; file uploads produce at least one FilePartEvent. The last
element that makes up a particular part will have isLast set to true.

The PartEventHttpMessageWriter is a HttpMessageWriter that writes a
Publisher<PartEvent> to a outgoing HTTP message. This writer is
particularly useful for relaying a multipart request on the server.

Closes gh-28006
2022-04-20 11:00:07 +02:00
Sam Brannen
1574fed90b Merge branch '5.3.x' 2022-04-13 10:08:31 +02:00
Sam Brannen
a7cf19cec5 Improve documentation and matching algorithm in data binders 2022-04-13 09:55:40 +02:00
Juergen Hoeller
8744952424 Merge branch '5.3.x' 2022-04-13 00:28:22 +02:00
Juergen Hoeller
0cf7f7bd89 Polishing 2022-04-13 00:24:23 +02:00
Arjen Poutsma
5fc8a9839c Do not add Accept-Ranges header on client-side
This commit fixes a regression that added the Accept-Ranges header on
both client and server. Accept-Ranges is response header, so we now make
sure it only appears on the server side.

See gh-28291
2022-04-12 10:36:49 +02:00
Juergen Hoeller
7e1782ea22 Merge branch '5.3.x'
# Conflicts:
#	build.gradle
#	spring-core/src/main/java/org/springframework/core/convert/Property.java
2022-04-08 13:10:34 +02:00
Juergen Hoeller
4143b445d6 Polishing 2022-04-08 13:04:14 +02:00
Sam Brannen
7a1421cb0f Suppress deprecation warnings in tests 2022-03-29 15:04:58 +02:00
Arjen Poutsma
28ac0d3883 Use HttpStatusCode interface
This commit contains changes made because of the introduction of
HttpStatusCode. In general, methods that used to return a HttpStatus
now return HttpStatusCode instead, and methods that returned raw status
codes are now deprecated.

See gh-28214
2022-03-23 12:49:38 +01:00
Sam Brannen
9a5891e6e6 Explicitly close ApplicationContexts and clean up warnings in tests
This commit also ensures that various test methods actually test
something now.
2022-03-20 12:34:56 +01:00
Sam Brannen
9764f0e59b Merge branch '5.3.x'
# Conflicts:
#	spring-test/src/test/java/org/springframework/mock/http/server/reactive/MockServerHttpRequestTests.java
#	spring-web/src/test/java/org/springframework/http/server/reactive/HeadersAdaptersTests.java
#	spring-web/src/test/java/org/springframework/web/client/RestTemplateIntegrationTests.java
#	spring-webflux/src/test/java/org/springframework/web/reactive/function/client/WebClientIntegrationTests.java
#	spring-webflux/src/test/java/org/springframework/web/reactive/result/method/annotation/SseIntegrationTests.java
#	spring-webmvc/src/test/java/org/springframework/web/servlet/handler/MappedInterceptorTests.java
#	spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/HandlerMethodAnnotationDetectionTests.java
#	spring-websocket/src/test/java/org/springframework/web/socket/AbstractWebSocketIntegrationTests.java
2022-03-16 15:07:53 +01:00
Sam Brannen
c462fe30ed Use Named arguments in parameterized tests 2022-03-16 14:45:47 +01:00
rstoyanchev
e7b97f5be7 Merge branch '5.3.x' into main 2022-03-16 09:27:43 +00:00
rstoyanchev
21d61316be Unwrap MappingJacksonValue before selecting ObjectMapper
See gh-28045
2022-03-16 05:55:58 +00:00
rstoyanchev
cb39b07088 Polishing Jackson encoder tests 2022-03-16 05:55:23 +00:00
rstoyanchev
b045e5baef Tests for ErrorResponse hierarchy to verify the output
See gh-27052
2022-02-28 13:40:05 +00:00
Phillip Webb
b3306f4e3d Suppress deprecation warning in WebAsyncManagerTests
See gh-27959
2022-02-15 15:11:31 -08:00
Sam Brannen
685a195ba1 Deprecate SocketUtils
SocketUtils was introduced in Spring Framework 4.0, primarily to assist
in writing integration tests which start an external server on an
available random port. However, these utilities make no guarantee about
the subsequent availability of a given port and are therefore
unreliable. Instead of using SocketUtils to find an available local
port for a server, it is recommended that users rely on a server's
ability to start on a random port that it selects or is assigned by the
operating system. To interact with that server, the user should query
the server for the port it is currently using.

SocketUtils is now deprecated in 5.3.16 and will be removed in 6.0.

Closes gh-28052
2022-02-15 14:28:58 +01:00
Sam Brannen
b3f786728e Use modern language features in tests 2022-02-03 15:35:32 +01:00