Commit Graph

2972 Commits

Author SHA1 Message Date
Brian Clozel a65c6f6884 Fix APPLICATION_PROBLEM_JSON_UTF8 media type value
This commit adds the missing "+json" suffix to the "application/problem"
media type for its deprecated UTF-8 variant.

Fixes gh-23825
2019-10-17 09:36:05 +02:00
Sam Brannen 972337e8f9 Introduce common .gitattributes file
Closes gh-23376
2019-10-02 15:22:39 +02:00
Juergen Hoeller 2861fc65bd Polishing 2019-09-27 10:17:56 +02:00
Sam Brannen f05b4625de Merge branch '5.1.x' 2019-09-26 10:55:55 +02:00
Sam Brannen 7d126d3288 Improve documentation regarding "annotated classes"
See gh-23638
2019-09-26 10:26:36 +02:00
Juergen Hoeller 3616e96792 Upgrade to SLF4J 1.7.28, Groovy 2.5.8, RxJava 2.2.12, Joda-Time 2.10.4, Rome 1.12.2, OkHttp 3.14.3, Apache HttpClient 4.5.10, Apache Johnzon 1.1.13 2019-09-25 22:27:41 +02:00
Rossen Stoyanchev 2995b6f224 Merge branch '5.1.x' 2019-09-25 17:28:24 +01:00
Rossen Stoyanchev 17c423f5af Support for sameSite attribute in WebFlux
Bypass server cookie and write Set-Cookie header directly for Reactor
Netty, and Servlet API which do not provide options.

For Undertow use the sameSite attribute.

Closes gh-23693
2019-09-25 17:16:48 +01:00
Rossen Stoyanchev 30e1257dda Merge branch '5.1.x' 2019-09-24 13:39:42 +01:00
Sam Brannen 402046f3c7 Polish data buffer allocation tests 2019-09-24 14:24:36 +02:00
Rossen Stoyanchev 4edc7196fb Refine disconnected client handling in WebFlux
If an error looks like a "disconnected client" but the response is not
yet committed then it can't be an I/O error from writing to the server
response. It is most likely as a result of a remote call as part of
request handling.

Not setting the response to 500 in this case results in a 200 response
status despite the error. Even if it was an I/O error from the server
response, setting the status won't impact a failed response.

Closes gh-23319
2019-09-24 11:09:42 +01:00
Sam Brannen 2572cd0503 Make PathPatternParserTests compatible with JDK 13
Closes gh-23669
2019-09-21 17:33:28 +02:00
Brian Clozel 4cfcc108fe Merge branch '5.1.x' 2019-09-17 09:49:47 +02:00
Brian Clozel ca2b2f5533 Wait for complete disposal of Reactor Netty resources
Fixes gh-23631
2019-09-17 09:49:05 +02:00
Phillip Webb d945ae9191 Add blank line between java and javax imports
See gh-23539

Co-authored-by: Sam Brannen <sbrannen@pivotal.io>
2019-09-16 13:41:59 +02:00
Sam Brannen bd28bb1f56 Add additional tests for HttpHeaders.keySet() operations
See gh-22821
2019-09-16 12:36:05 +02:00
Phillip Webb aa69703f3b Fix LinkedCaseInsensitiveMap collection methods
Ensure that results returned from keySet, entrySet & values are tracked
to remove case insensitive keys from the source map.

Closes gh-22821
2019-09-16 12:36:05 +02:00
Sam Brannen a871f609ea Introduce failing tests for HttpHeaders
See gh-22821
2019-09-16 12:28:38 +02:00
Sam Brannen 52128fe863 Polish RequestLoggingFilterTests 2019-09-16 11:35:26 +02:00
Napster 33cee066e5 Log HTTP method in logging filters and revise log message format
Closes gh-23567
2019-09-16 11:35:26 +02:00
Sam Brannen cf5cb9484a Add additional tests for HttpHeaders.keySet() operations
See gh-22821
2019-09-15 15:48:37 +02:00
Sam Brannen 957f0fac7a Polishing 2019-09-13 12:55:59 +02:00
Phillip Webb 5d785390eb Add `ClientHttpRequestInitializer` support
Add `ClientHttpRequestInitializer` interface that can be used with any
`HttpAccessor` to initialize each `ClientHttpRequest` before it's used.

This provides a useful alternative to `ClientHttpRequestInterceptor`
when users need to configure things like `HttpHeaders`.

Closes gh-22002
2019-09-12 16:01:46 -07:00
Rossen Stoyanchev 7194261961 Merge branch '5.1.x' 2019-09-12 21:17:00 +01:00
Rossen Stoyanchev 23be5dfb0e Handle invalid MediaType in Jetty/Tomcat adapters
See: gh-23553
2019-09-12 20:58:47 +01:00
Rossen Stoyanchev b7eaab4c5d Handle very early completion notification
On a Servlet container a completion notification may come at any time
even in the UNSUBSCRIBED state, i.e. before the write Publisher has
called onSubscribe.

See: gh-23553
2019-09-12 14:14:11 +01:00
Rossen Stoyanchev 07b0fa132e doFilterNestedErrorDispatch delegates to filter chain
Closes: gh-23596
2019-09-12 13:42:12 +01:00
Sam Brannen 30cff46e7f Prevent improper use of testing framework APIs
Prior to this commit, a lot of work had been done to prevent improper
use of testing Framework APIs throughout the codebase; however, there
were still some loopholes.

This commit addresses these loopholes by introducing additional
Checkstyle rules (and modifying existing rules) to prevent improper use
of testing framework APIs in production code as well as in test code.

- Checkstyle rules for banned imports have been refactored into
  multiple rules specific to JUnit 3, JUnit 4, JUnit Jupiter, and
  TestNG.
- Accidental usage of org.junit.Assume has been switched to
  org.junit.jupiter.api.Assumptions.
- All test classes now reside under org.springframework packages.
- All test classes (including abstract test classes) now conform to the
  `*Tests` naming convention.
  - As an added bonus, tests in the renamed
    ScenariosForSpringSecurityExpressionTests are now included in the
    build.
- Dead JUnit 4 parameterized code has been removed from
  DefaultServerWebExchangeCheckNotModifiedTests.

Closes gh-22962
2019-09-12 11:20:56 +02:00
Sam Brannen 5d5f9aceca Avoid accidental usage of JUnit 4 assumptions
This commit also avoids starting a server if an assumption fails.
2019-09-06 16:03:36 +02:00
Sam Brannen 591995ecc8 Polish and revive disabled tests
This commit revives some previously disabled tests and converts
some usage of @Disabled to @EnabledForTestGroups(...).
2019-09-06 15:57:27 +02:00
Sam Brannen d9e3b8b9a5 Introduce default constructor in TomcatHttpServer 2019-09-05 13:45:38 +02:00
Sam Brannen 73f5d05fd9 Avoid deprecation warning in RandomHandlerIntegrationTests 2019-09-05 13:29:01 +02:00
Phillip Webb deba2ed1b3 Add blank line between java and javax imports
See gh-23539
2019-09-04 22:05:46 -07:00
Rossen Stoyanchev bc81fa520e Reject range starting above resource length
Closes: gh-23576
2019-09-04 18:05:59 +01:00
Brian Clozel 0c7359911a Re-enable StreamingSimpleClientHttpRequestFactoryTests
Since the okhttp3 3.14 downgrade, we don't need to ignore this test
anymore.
2019-09-04 16:02:43 +02:00
Brian Clozel cccd9c8bb0 Fix okhttp3 downgrade 2019-09-04 15:07:17 +02:00
Sam Brannen 00983a1141 Update @Disabled for StreamingSimpleClientHttpRequestFactoryTests.interceptor() 2019-09-04 14:37:37 +02:00
Sam Brannen 4d819128db Fix Javadoc 2019-09-04 14:33:02 +02:00
Sam Brannen 513ce7824f Disable StreamingSimpleClientHttpRequestFactoryTests.interceptor() test 2019-09-03 16:43:48 +02:00
Rossen Stoyanchev d927d31e13 Remove reflection from ContentDispositionTests
Also minor refactoring in decoding in order to tolerate the absence of
a charset and treat as US_ASCII.

See gh-23485
2019-09-03 12:31:13 +01:00
Rossen Stoyanchev c97580035e Polish ContentDispositionTests
Closes gh-23485
2019-09-03 12:31:13 +01:00
Jonathan Bluett-Duncan f084b63286 Fix "array index out of bounds" problem reported by LGTM.com 2019-09-03 12:31:13 +01:00
Sam Brannen 5fd81d2a26 Avoid deprecation warning in AbstractMockWebServerTests
MockResponse.setHeaders(Headers) is now deprecated.
2019-09-03 12:13:09 +02:00
Brian Clozel d4089747b8 Use dependency management in Framework build
Prior to this commit, the Spring Framework build would partially use the
dependency management plugin to import and enforce BOMs.

This commit applies the dependency management plugin to all Java
projects and regroups all version management declaration in the root
`build.gradle` file (versions and exclusions).

Some versions are overridden in specific modules for
backwards-compatibility reasons or extended support.

This commit also adds the Gradle versions plugin that checks for
dependency upgrades in artifact repositories and produces a report; you
can use the following:

    ./gradlew dependencyUpdates
2019-09-02 18:01:09 +02:00
Sebastien Deleuze ca02cc1194 Migrate to AssertJ in Kotlin tests
Closes gh-23475
2019-09-02 15:59:26 +02:00
康智冬 a6f4862f13 Fix typos related to indefinite articles
Closes gh-23555
2019-09-01 15:45:49 +02:00
Sam Brannen 0103fec5de Convert assertions to AssertJ
See gh-23551
2019-08-31 13:13:44 +02:00
Sam Brannen 5a22eafcb4 Merge branch '5.1.x' 2019-08-31 13:10:58 +02:00
Sam Brannen 9729b460f1 Retain entry set order in read-only HttpHeaders
Prior to this commit, the entry set of read-only HttpHeaders lost the
original headers' ordering.

The changes in commit ce7278aaf4 introduced a regression in the read-only
HttpHeaders support. Specifically, the implementation of entrySet() in
the internal ReadOnlyHttpHeaders class converted the original entry set
to an immutable, non-ordered set of immutable entries.

This commit fixes this issue by converting the original entry set to an
immutable, ordered set of immutable entries.

Closes gh-23551
2019-08-31 13:10:07 +02:00
Sam Brannen a496353770 Delete dead code 2019-08-31 11:44:04 +02:00