Commit Graph

1581 Commits

Author SHA1 Message Date
Andreas Ahlenstorf
cd6085a310 Add kotlinx.serialization JSON support to Spring MVC
Closes gh-21188

Co-authored-by: Sebastien Deleuze <sdeleuze@vmware.com>
2020-09-14 23:25:16 +02:00
Rossen Stoyanchev
b50ad1b9aa AbstractServerHttpResponse skips commit actions on 2nd pass
Closes gh-25753
2020-09-13 21:21:07 +01:00
Brian Clozel
b2a0978c12 Prepare for Sinks API updates in Reactor
See reactor/reactor-core#2374
All usages of this API are in tests, which are not checking overflow or
concurrent emissions - so a simple replacement with `try***` equivalents
is fine.
2020-09-11 16:34:31 +02:00
Arjen Poutsma
3bd96a665f Merge branch '5.2.x' into master 2020-09-10 11:34:44 +02:00
Arjen Poutsma
07d2c08f48 Do not tokenize Forward header value
This commit remove the tokenization previously used in
UriComponentsBuilder#adaptFromForwardedHeaders, in order to support
Forwarded headers that have multiple, comma-separated 'for' elements.

Closes gh-25737
2020-09-09 16:31:24 +02:00
Rossen Stoyanchev
dd011c991c Merge branch '5.2.x' into master 2020-09-07 21:41:30 +01:00
Rossen Stoyanchev
899761f0a8 Avoid unnecessary parsing of path params
See gh-25690
2020-09-07 21:27:52 +01:00
Arjen Poutsma
d550d344d5 Respect context path in WebMvc.fn & WebFlux.fn
This commit makes several changes in both WebMvc.fn as well as
WebFlux.fn.

 - ServerRequest now exposes a RequestPath through requestPath(), and
   pathContainer() has been deprecated.

 - The PathPredicate and PathResourceLookupFunction now respects this
   RequestPath's pathInApplication() in their path-related
   functionality.

 - When nesting, the PathPredicate now appends the matched part of the
   path to the current context path, instead of removing the matched
   part (which was done previously). This has the same result: the
   matched part is gone, but now the full path stays the same.

Closes gh-25270
2020-09-03 15:10:56 +02:00
Johnny Lim
603d7e93b9 Copy httpHandlerDecorator in copy constructor for WebHttpHandlerBuilder
This commit also polishes its Javadoc and fixes its test along the way.
2020-09-01 10:09:34 +02:00
Rossen Stoyanchev
21d25b23d9 WebFlux extension point to decorate the HttpHandler
Closes gh-25633
2020-08-27 10:50:30 +01:00
Rossen Stoyanchev
a7f71f4d9b Support filename hint for client side too
Closes gh-25516
2020-08-14 15:18:39 +01:00
Sam Brannen
4d3dd9b9f6 Clean up warnings in Gradle build 2020-08-11 17:20:27 +02:00
Sam Brannen
d0cf90bb8e Update tests due to deprecations in Reactor 2020-08-08 12:40:23 +02:00
Brian Clozel
b6d2a2980d Update for Reactor API changes 2020-08-05 13:31:39 +02:00
Sébastien Deleuze
5c456db3cc Upgrade to Kotlin 1.4 RC
- The compiler is configured to retain compatibility with Kotlin 1.3.
- Explicit API mode is not yet enabled but could be in the future.
- Some exceptions thrown by Kotlin have changed to NullPointerException,
  see https://youtrack.jetbrains.com/issue/KT-22275 for more details.

Closes gh-24171
2020-07-30 10:18:33 +02:00
Rossen Stoyanchev
683cc2eb7f Add NDJSON and deprecate application/stream+json
Closes gh-21283
2020-07-28 17:53:37 +03:00
Rossen Stoyanchev
354635ede0 Polishing 2020-07-28 17:53:37 +03:00
Sam Brannen
cdc234d7db Polish contribution
See gh-25446
2020-07-22 14:06:29 +02:00
XenoAmess
c547809e89 Use instanceof instead of Class#isInstance where feasible
Closes gh-25446
2020-07-22 14:06:29 +02:00
Juergen Hoeller
88394bff66 Merge branch '5.2.x' 2020-07-20 07:21:36 +02:00
Juergen Hoeller
65e601090f Copy queryParams MultiValueMap through addAll (for independent List entries)
Closes gh-25423
2020-07-20 07:07:17 +02:00
Rossen Stoyanchev
0e4e25d227 Updates to CORS patterns contribution
Closes gh-25016
2020-07-08 13:18:46 +03:00
Rossen Stoyanchev
1181bb1852 Rename originsPattern to originPatterns
See gh-25016
2020-07-08 13:18:46 +03:00
Ruslan Akhundov
8632118e8d CorsConfiguration now supports pattern based origins.
Closes gh-24763
2020-07-08 13:18:46 +03:00
Johnny Lim
72e92211ce Polish mutateContextPathWithoutUpdatingPathShouldFail()
Closes gh-25352
2020-07-02 16:58:32 +02:00
Arjen Poutsma
f13ab6d18c Merge branch '5.2.x' 2020-07-01 13:29:15 +02:00
Arjen Poutsma
5b94d9b00b Use UTF-8 for application/*+json
This commit makes sure that the StringHttpMessageConverter reads
input with "application/*+json" as Content-Type with the UTF-8
character set.

Closes gh-25328
2020-07-01 10:46:58 +02:00
Arjen Poutsma
e251075d6c Merge branch '5.2.x' 2020-06-30 15:49:19 +02:00
Arjen Poutsma
79c339b03e Support for ASCII in Jackson codec & converter
This commit introduces support for writing JSON with an US-ASCII
character encoding in the Jackson encoder and message converter,
treating it like UTF-8.

See gh-25322
2020-06-30 15:46:54 +02:00
Sam Brannen
a92441186c Check for valid IPv6 host in UriComponentsBuilder.fromUriString
PR gh-358 introduced a "scheme but no host" check in the fromHttpUrl()
method in UriComponentsBuilder, but a similar check was not added to
fromUriString() at that time.

This commit introduces a "scheme but no host" check in fromUriString()
to align with the functionality in fromHttpUrl().

Note, however that the regular expressions used to match against the
hostname or IP address are inexact and still permit invalid host names
or IP addresses. True validation of the host portion of the URI is out
of scope for this commit.

Closes gh-25334
2020-06-29 18:36:21 +02:00
Sam Brannen
ba5f4f5414 Merge branch '5.2.x' 2020-06-26 18:31:07 +02:00
Sam Brannen
9876ca003b Support fragments in UriComponentsBuilder.fromHttpUrl()
Prior to this commit, UriComponentsBuilder.fromHttpUrl() threw an
IllegalArgumentException if the provided URL contained a fragment.

This commit aligns the implementation of fromHttpUrl() with that of
fromUriString(), by parsing a fragment and storing it in the builder.

Closes gh-25300
2020-06-26 18:30:09 +02:00
Sam Brannen
dd11dbf3b1 Polish UriComponentsBuilderTests 2020-06-26 14:58:06 +02:00
Rossen Stoyanchev
115ea253f6 Fix typo 2020-06-24 16:29:47 +01:00
Rossen Stoyanchev
b16f6fa456 Shared static instance of DefaultDataBufferFactory 2020-06-24 16:12:56 +01:00
Philippe Marschall
a142d21700 Use @SafeVarargs in Jackson builder and factory
Using @SafeVarargs in Jackson mapper builder and factory bean classes
allows the varargs methods to be used without a compiler warning. The
implementations of these methods do not perform unsafe operations on
their varargs parameter. It is therefore safe to add this annotation.

The following two methods are changed:

- add @SafeVarargs to Jackson2ObjectMapperBuilder#modulesToInstall
  and make it final
- add @SafeVarargs to
  Jackson2ObjectMapperFactoryBean#setModulesToInstall and make it final

This is a backwards incompatible change as these methods now have to be
declared final. Existing subclasses that override one of these methods
will break.

Closes gh-25311
2020-06-24 15:38:21 +02:00
Sam Brannen
b33d2fe683 Clean up warnings in Gradle build, polishing, etc. 2020-06-24 15:02:24 +02:00
Arjen Poutsma
973ee9b852 (Re)introduce DefaultMultipartMessageReader
This commit introduces the DefaultMultipartMessageReader, a fully
reactive multipart parser without third party dependencies.

An earlier version of this code was introduced in fb642ce, but removed
again in 77c24aa because of buffering issues.

Closes gh-21659
2020-06-24 10:31:48 +02:00
Rossen Stoyanchev
57f868fcbd Direct matches by URL path work again
This commit fixes a recent regression as a result of 5225a57411
with the determination of non-pattern vs pattern URLs. That in turn affects the ability to perform
direct matches by URL path.

There is also a fix in PathPattern to recognize "catch-all" patterns as pattern syntax.

See gh-24945
2020-06-24 08:07:40 +01:00
Rossen Stoyanchev
22bf62def1 Replace remaining use of deprecated Processors in tests
See gh-25085
2020-06-23 20:29:35 +01:00
Brian Clozel
1f78cede72 Merge branch '5.2.x' 2020-06-22 19:21:32 +02:00
Brian Clozel
c4326cb0f5 Fix missing contextPath when mutating ServerHttpRequest
This commit ensures that when mutating `ServerHttpRequest` instances,
the original contextPath information is copied to the request being
built.

Note that mutation on the `contextPath(String)` or `path(String)` should
be reflected to the other. (See their Javadoc for more information).

Fixes gh-25279
2020-06-22 19:13:10 +02:00
Sam Brannen
eeb6c10fb7 Polishing 2020-06-22 14:03:06 +02:00
Sam Brannen
b733474c64 Polish contribution
See gh-25292
2020-06-22 13:23:40 +02:00
Undefined
53df8ca1f5 Introduce unit tests for IntegerToEnumConverterFactory
Closes gh-25292
2020-06-22 13:12:37 +02:00
Rossen Stoyanchev
d627f6049e Update "Forwarded: for" contribution
Closes gh-23582
2020-06-22 05:40:13 +01:00
Kirill Serebrennikov
883ad098f9 Add support for X-Forwarded-For and Forwarded for
See gh-23260, gh-23582
2020-06-22 05:40:13 +01:00
Sam Brannen
ab0e651547 Polish SerializationTestUtils, clean up warnings, etc. 2020-06-20 18:17:03 +02:00
Sam Brannen
9d5881e0ad Suppress warnings, remove unused code, etc. 2020-06-20 17:15:35 +02:00
Sébastien Deleuze
6b355df903 Revert "Upgrade to Kotlin 1.4 M2"
This reverts commit 2a74eff10f.

Some regressions require to wait at least Kotlin 1.4 M3.
2020-06-18 14:06:39 +02:00