Commit Graph

1949 Commits

Author SHA1 Message Date
Phillip Webb
64930d4e5b Polish caught exception names
Prefer `ex` over `e`.
2018-05-03 09:46:15 -07:00
Phillip Webb
3ee777e142 Polish ternary expressions
Consistently format ternary expressions and always favor `!=` as the
the check.
2018-05-03 09:46:15 -07:00
Andy Wilkinson
06cf698387 Polish 2018-05-02 12:12:47 +01:00
Andy Wilkinson
a29a70d2f4 Fix handling of static resource jar paths containing a +
Closes gh-12942
2018-05-02 10:23:42 +01:00
Andy Wilkinson
c78bc0585c Make tests' detection of SSL handshake failures more robust
Closes gh-12961
2018-04-25 11:47:36 +01:00
Spring Buildmaster
c10aad165f Next Development Version 2018-04-09 23:14:33 +00:00
Andy Wilkinson
a06de4d997 Stop error page filter from commiting response prematurely
Previously, the error page filter used sendError to set the response
status when handling an exception and before forwarding the request
to the error controller. Following the fix for gh-11814, this meant
that the error controller was unable to write its response and the
containers default error page was returned instead.

This commit updates the error page filter to use setStatus rather than
sendError. This ensures that the response has the correct status code
while allowing the error controller to write its body. Tests have
been added to the Tomcat deployment test suite to verify that the
error page filter behaves as intended when dealing with a sent error
and an exception for requests accepting HTML, JSON, or anything.

Closes gh-12787
2018-04-09 16:14:27 +01:00
Spring Buildmaster
ade4760842 Next Development Version 2018-04-05 09:01:52 +00:00
Andy Wilkinson
c4923d6273 Ignore existing output when asserting captured log output
Closes gh-12734
2018-04-04 14:14:45 +01:00
Andy Wilkinson
ac88a60071 Ensure error is sent before Writer or OutputStream is used
Previously, ErrorPageFilter's ErrorResponseWrapper would delaying
sending an error back to the client. In cases where the response's
Writer or OutputStream was accessed and flushed or closed, this could
lead to the wrong response status being sent.

This commit updates ErrorResponseWrapper so that it will send any
capture error to the client before returning the response's Writer or
OutputStream. This ensures that closing the Writer or OutputStream
does not cause the response to be committed with the default response
status rather than the previously captured error status.

Such responses will now include the correct status, but will not be
forwarded to the error controller. Such forwarding is not possible
due to the response already having been committed.

Closes gh-11814
2018-04-04 13:49:08 +01:00
Andy Wilkinson
dee8750aff Stop Jetty in Jetty8JettyEmbeddedServletContainerFactoryTests
Closes gh-12734
2018-04-03 15:53:00 +01:00
Andy Wilkinson
edc00eef24 Ensure that Tomcat is completely stopped when its initialization fails
Closes gh-12736
2018-04-03 15:53:00 +01:00
Andy Wilkinson
30de75c75c Ensure that Jetty is completely stopped when it fails to start
Closes gh-12735
2018-04-03 15:53:00 +01:00
Andy Wilkinson
6078fdaed8 Polish "Use modifiable set for @ServletComponentScan with no packages"
Closes gh-12715
2018-04-03 10:47:28 +01:00
Wenwei Liao
7bec780281 Use modifiable set for @ServletComponentScan with no packages
Previously, when a project contained multiple `@ServletComponentScan`
annotated classes in classpath, and at least one annotation don't
explicitly specify `basePackages` and `basePackageClass` attribute,
the application could fail to start with an
UnsupportedOperationException. The failure occurred due to the
creating of an unmodifiable set when no base packages are configured
and a subsequent attempt to add base packages to that sit.

This commit fixes the issue by removing the use of an unmodifiable set
when `@ServletComponentScan` with no base packages in processed before
any other `@ServletComponentScan` annotations.

See gh-12715
2018-04-03 10:47:18 +01:00
Phillip Webb
a8f366a554 Fix copyright header for edited files 2018-03-16 15:07:23 -07:00
Stephane Nicoll
4e3d0f5b33 Fix parsing of value with comma
Closes gh-12297
2018-03-01 17:26:20 +01:00
Andy Wilkinson
452492183d Polish
Closes gh-11991
2018-02-28 14:48:11 +00:00
Andy Wilkinson
88423c504b Polish "Fix handling of static resource jars with spaces in their paths"
Closes gh-11991
2018-02-28 10:40:43 +00:00
Rupert Madden-Abbott
9cd1a4b07a Fix handling of static resource jars with spaces in their paths
See gh-11991
2018-02-28 09:46:29 +00:00
Andy Wilkinson
eaf3789540 Polish "Set host when creating Jetty SSL connector"
Closes gh-12120
2018-02-27 14:39:59 +00:00
mtrejo
f0905ffaf6 Set host when creating Jetty SSL connector
See gh-12120
2018-02-27 14:39:45 +00:00
Phillip Webb
98f58caeaf Reset default local after test completes 2018-02-26 22:22:21 -08:00
Phillip Webb
8f9c067a92 Polish 2018-02-26 22:16:08 -08:00
Madhura Bhave
257e324bd5 Add tests for binding to enum with different locale
See gh-12213
2018-02-26 12:28:28 -08:00
Stephane Nicoll
b4a7e1d64b Use toLowerCase() and toUpperCase() with Locale.ENGLISH
This commit updates all `toLowerCase()` and `toUpperCase` invocations to
use the variant that takes a `Locale` to avoid locale-specific side
effect.

Closes gh-12213
2018-02-26 17:49:03 +01:00
Stephane Nicoll
3db5c70b58 Make sure binder properly resolve resources
This commit makes sure that `@ConfigurationProperties` binding resolves
resources properly. In particular, any `ProtocolResolver` registered on
the `ApplicationContext` is now honoured.

Closes gh-11569
2018-02-20 14:10:22 +01:00
Andy Wilkinson
145d8d2673 Defer removal of Connectors until after ServletContext initialization
Previously, we removed the Connectors from Tomcat's Service before
the Context was started. The removal of the Connectors is required as
it prevents Tomcat from accepting requests before we're ready to
handle them.

Part of starting the Context is creating and initializing the
ServletContext. ServerProperties uses a ServletContextInitializer to
set the session tracking modes and Tomcat rejects the SSL tracking
mode if there is no SSL-enabled connector available. With the previous
arrangement this led to a failure as the Connectors had been removed
so the SSL-enabled connector could not be found.

This commit updates the embedded Tomcat container to defer the
removal of the Connectors until after the context has been started
but still at a point that is before the Connectors themselves would
have been started.

Closes gh-12058
2018-02-14 17:04:55 +00:00
Stephane Nicoll
2f6d05dc51 Fix parsing of String value in json
Closes gh-11992
2018-02-12 17:05:32 +01:00
Stephane Nicoll
da01744e4c Merge pull request #11981 from eiselems:1.5.xMysqlValidationQuery
* pr/11981:
  Update MySQL validation query to use lightweight ping
  Polish
  Reinject mocks when context is dirtied before each method
  Polish “Prevent reverse name lookup when configuring Jetty's address”
  Prevent reverse name lookup when configuring Jetty's address
  Fixup version numbers following release
  Next Development Version
  Protect against symlink attacks
  All CLI support for Windows MINGW environments
  Polish
2018-02-10 15:05:58 +01:00
Marcus Eisele
37ce1784ab Update MySQL validation query to use lightweight ping
Closes gh-11981
2018-02-10 15:04:29 +01:00
Andy Wilkinson
dc1e1e8280 Polish “Prevent reverse name lookup when configuring Jetty's address”
Closes gh-11889
2018-02-10 15:03:53 +01:00
Henrich Kraemer
dc48a90184 Prevent reverse name lookup when configuring Jetty's address
Previously, the host on Jetty's connector was configured using the
host address of the InetSocketAddress. This could result in reverse
name resolution that could cause Jetty to bind to a different IP
address than was configured.

This commit updates the configuration code to use the host string
when specifically does not perform reverse name resolution.

See gh-11889
2018-02-10 15:03:53 +01:00
Spring Buildmaster
aa6cb9744b Next Development Version 2018-02-10 15:03:53 +01:00
Phillip Webb
af8e155c6d Polish 2018-02-10 15:03:53 +01:00
Phillip Webb
798522d890 Format with Eclipse Oxygen SR2 2018-02-08 15:46:49 -08:00
Andy Wilkinson
a1b823fc43 Polish “Prevent reverse name lookup when configuring Jetty's address”
Closes gh-11889
2018-02-02 14:55:57 +00:00
Henrich Kraemer
2066fa7d0b Prevent reverse name lookup when configuring Jetty's address
Previously, the host on Jetty's connector was configured using the
host address of the InetSocketAddress. This could result in reverse
name resolution that could cause Jetty to bind to a different IP
address than was configured.

This commit updates the configuration code to use the host string
when specifically does not perform reverse name resolution.

See gh-11889
2018-02-02 14:44:17 +00:00
Spring Buildmaster
6414b42335 Next Development Version 2018-01-30 23:29:33 +00:00
Phillip Webb
61f7bd8576 Polish 2018-01-30 12:37:40 -08:00
Andy Wilkinson
4ecc7b9211 Polish 2018-01-29 20:10:29 +00:00
Andy Wilkinson
5a74f63f7c Polish "Configure ErrorReportValve not to report stack traces"
Closes gh-11790
2018-01-29 19:50:07 +00:00
Alex Panchenko
29736e340e Configure ErrorReportValve not to report stack traces
See gh-11790
2018-01-29 17:23:49 +00:00
Andy Wilkinson
b6576fbe9c Test compression defaults against 8.5.24 as they changed in 8.5.27
See gh-11727
2018-01-22 21:00:13 +00:00
Phillip Webb
8e783cdae9 Polish 2018-01-18 21:42:11 -08:00
Stephane Nicoll
08ec3d2735 Improve class condition check
This commit improves a class condition check on the actual
implementation rather than the general purpose interface.

Closes gh-11608
2018-01-16 11:09:56 +01:00
Brian Clozel
966d4251a4 Warn against custom request factories in RestTemplateBuilder
This commit adds a javadoc note about a usability issue described in
gh-11255. While `RestTemplateBuilder` is an immutable class, providing a
custom instance of request factory and deriving several
builders/templates from that point may have some unexpected behavior,
since that instance is shared amongst builders instances.

This issue is fixed in Spring Boot 2.0 with a replacement method that
leverages a `Supplier<ClientHttpRequestFactory>` instead.

See gh-11255
2018-01-05 16:24:34 +01:00
Brian Clozel
88b15baf20 Upgrade to Jetty 9.4.8.v20171121
Closes gh-11469
2018-01-02 16:06:45 +01:00
Phillip Webb
2aa3295675 Deprecate inapplicable RegistrationBean methods
Inherit and deprecate RegistrationBean methods that are not applicable
to a ServletListenerRegistrationBean.

Fixes gh-11342
2017-12-13 12:21:57 -08:00
Phillip Webb
2c429ba77d Restore static final formatting
Restore static final constants to upper case formatting.

See gh-10457
2017-12-13 12:21:57 -08:00