5115 Commits

Author SHA1 Message Date
Brian Clozel
c233125f1d Don't render error view if response is committed
This commit prevents the default error view from rendering itself if the
response has been committed already. In this case, it is impossible to
change the HTTP response status and write a proper response - trying to
do so often results in a `IllegalStateException` since the response body
has already been written to.

Fixes gh-11580
2018-01-18 11:40:11 +01:00
Stephane Nicoll
40c537daa0 Polish 2018-01-18 10:20:48 +01:00
Andy Wilkinson
54c0cf513b Polish 2018-01-17 19:03:23 +00:00
Andy Wilkinson
3904f49c9f Configure ServletContext before initializing S…C…Initializer beans
Previously, the ServletContext was configured after any
ServletContextInitializer beans had been initialized. This meant that
any configuration class that provided such a bean would be initialized
before the ServletContext was configured. If the configuration class
used the ServletContext in its initializtaion that it would see it in
its default, unconfigured state.

This commit reworks the configuration of the ServletContext so that
it happens before any ServletContextInitializer beans are initialized.

Closes gh-10699
2018-01-17 17:32:23 +00:00
Johnny Lim
d27b46cf73 Fix a wrong import for SocketChannel
Closes gh-11648
2018-01-17 13:49:57 +01:00
Brian Clozel
1f26a0314c Sanitize inputs in default reactive HTML error view
This commit uses HTML escaping to sanitize error inputs that are
displayed in the default reactive HTML error view.

Fixes gh-11582
2018-01-16 17:20:12 +01:00
Stephane Nicoll
bf88073f7e Tighten Liquibase auto-configuration to require Liquibase 3
Closes gh-11641
2018-01-16 12:02:03 +01:00
Stephane Nicoll
023bc13fb6 Merge branch '1.5.x' 2018-01-16 11:46:42 +01:00
Brian Clozel
1e648801bd Move spring.mvc.media-types to content-negotiation
This commit moves "spring.mvc.media-types" to the
"spring.mvc.content-negotiation.*" namespaces introduced in gh-11105.

Closes gh-11636
2018-01-16 11:35:49 +01:00
Brian Clozel
22c22a1ced Move server.session.* to server.servlet.session.*
Closes gh-11589
2018-01-15 17:50:32 +01:00
Andy Wilkinson
23d8d608c4 Polish 2018-01-15 13:35:46 +00:00
Brian Clozel
67e5897c40 Disable suffix pattern matching in Spring MVC
This commit disables by default suffix pattern matching in Spring MVC
applications. As described in the Spring MVC documentation (see
https://docs.spring.io/spring/docs/current/spring-framework-reference/web.html#mvc-ann-requestmapping-suffix-pattern-match),
this is considered as best practice.

This change also introduces new configuration properties to achieve
similar results in a safer way (using query parameters) or to rollback
to the former default.

Closes gh-11105
2018-01-15 11:58:26 +01:00
Johnny Lim
77150f8dc9 Polish
Closes gh-11630
2018-01-15 10:20:31 +01:00
Stephane Nicoll
3f88906b97 Fix handling of ResponseStatusException
This commit updates DefaultErrorAttributes to handle
ResponseStatusException explicitly. This exception is used in a
WebFlux application to signal that the processing of the query has
failed with an HTTP status code and a reason phrase. The latter is now
properly mapped to the `message` attribute of the response body.

Closes gh-11614
2018-01-15 10:03:15 +01:00
Andy Wilkinson
2b99962a85 Replace use of Date with OffsetDateTime and Instant in Actuator
Closes gh-10976
2018-01-12 17:26:05 +00:00
Stephane Nicoll
8aaf95b792 Polish 2018-01-12 11:40:35 +01:00
Johnny Lim
136e26e307 Fix typo in DynamicRegistrationBean class name
Closes gh-11606
2018-01-12 01:44:45 +01:00
Stephane Nicoll
4a9123d6e3 Detect user-defined RedisCacheConfiguration
This commits improves the cache auto-configuration for Redis by looking
up a custom "RedisCacheConfiguration" bean that allows to take full
control over the `RedisCacheManager`.

Closes gh-11599
2018-01-11 11:52:08 +01:00
Brian Clozel
98ac2218db Apply server.undertow.* config to reactive servers
This commit applies `server.undertow.*` configuration properties
to Undertow when configured as a reactive web server.

See gh-11500
2018-01-11 11:15:23 +01:00
Brian Clozel
15bc718248 Apply server.jetty.* config to reactive servers
This commit applies `server.jetty.*` configuration properties
to Jetty when configured as a reactive web server.

It also removes some infrastructure support for Jetty 8, which
is not supported anymore in Spring Boot 2.0 (partial fix for
gh-11504).

See gh-11500
2018-01-11 11:15:17 +01:00
Brian Clozel
d264af8142 Apply server.tomcat.* config to reactive servers
This commit applies most `server.tomcat.*` configuration
properties to Tomcat when set up as a reactive web server.

Some Servlet-specific properties are not applied:

* server.tomcat.additional-tld-skip-patterns
* server.tomcat.redirect-context-root
* server.tomcat.use-relative-redirects

Fixes gh-11334
2018-01-11 11:15:02 +01:00
Stephane Nicoll
b2eae0006d Polish "Make GsonAutoConfiguration align with JacksonAutoConfiguration"
Closes gh-11591
2018-01-11 10:36:58 +01:00
Johnny Lim
50518514b0 Make GsonAutoConfiguration align with JacksonAutoConfiguration
See gh-11591
2018-01-11 10:16:35 +01:00
Madhura Bhave
e57aafd63d Provide EndpointRequest for WebFlux-based Security
Closes gh-11022
2018-01-09 16:06:36 -08:00
Phillip Webb
b078698f20 Update copyright year of changed files 2018-01-09 12:13:27 -08:00
Phillip Webb
b3ec2c9d1d Polish 2018-01-09 12:12:59 -08:00
Stephane Nicoll
df647605af Merge branch '1.5.x' 2018-01-09 13:28:08 +01:00
Johnny Lim
b8706c47d6 Use instance equality for Class
Closes gh-11534
2018-01-09 09:30:36 +01:00
Johnny Lim
0f0c6e0729 Polish
Closes gh-11536
2018-01-09 09:28:56 +01:00
Phillip Webb
286a3bb10a Polish GSON customization support
Closes gh-11498
2018-01-08 23:13:46 -08:00
ioann
ba552f1d24 Allow GSON customization via properties or beans
Update GSON support to allow customization with either properties or
customize beans.

See gh-11498
2018-01-08 22:37:55 -08:00
Phillip Webb
9cb5f3da89 Create DynamicRegistrationBean
Extract functionality from the `RegistrationBean` into a new class
designed to work with dynamic registration. Servet and Filter
registration beans now extend from `DynaimcRegistrationBean`, where as
`ServletListenerRegistrationBean` extends directly from
`RegistrationBean`.

This refactor allows the removal of `ServletListenerRegistrationBean`
deprecated methods.

Fixes gh-11344
2018-01-08 22:05:00 -08:00
Phillip Webb
fb614c64da Revert "Build against Spring Security 5.0.1 SNAPSHOT"
This reverts commit 2c52b9e87a3b86a349b4dc4a19adcfdfcf19886b
since the SNAPSHOT BOM doesn't appear to be published.

See gh-11573
2018-01-08 18:09:07 -08:00
Phillip Webb
2d76aad03e Further refine test containers 2018-01-08 17:24:42 -08:00
Phillip Webb
201da97774 Further refine test containers 2018-01-08 16:32:39 -08:00
Phillip Webb
2c52b9e87a Build against Spring Security 5.0.1 SNAPSHOT
See gh-11573
2018-01-08 15:19:06 -08:00
Phillip Webb
19ce0aa4f0 Refine BackgroundPreinitializer
Update `BackgroundPreinitializer` to start initialization earlier. Also
refine the startup order and initialize Charsets.

Fixes gh-11570
See gh-11412
2018-01-08 15:19:06 -08:00
Phillip Webb
25609c060e Polish 2018-01-08 15:19:06 -08:00
Madhura Bhave
9a6c339243 Use TestContainers util from spring-boot-test-support
See gh-10516
2018-01-08 14:05:15 -08:00
Andy Wilkinson
996b3ef7f2 Refine test containers 2018-01-08 14:05:05 -08:00
Andy Wilkinson
12e1fcbfab Do not pass null credential from ConnectionString to Mongo builder 2018-01-08 15:21:14 +00:00
Andy Wilkinson
c7f5f0735d Stop reusing the Cluster when waiting for Cassandra to start
See gh-10516
2018-01-08 14:13:21 +00:00
Andy Wilkinson
927003e0b7 Polish 2018-01-08 13:59:14 +00:00
Stephane Nicoll
b98c7ed9f8 Add InvalidConfigurationPropertyValueException
This commit adds a new exception type that denotes the value of a
configuration key is invalid, alongside a FailureAnalyzer that reports
a human-readable report when such exception is thrown on startup.

ResourceNotFoundException being a (useless) specialization of this new
exception, its usage has been refactored to use the more general
exception type.

Closes gh-10794
2018-01-08 14:24:57 +01:00
Stephane Nicoll
b7f60c2ded Configure NettyStreamFactoryFactory by default if available
Closes gh-11526
Closes gh-10961
2018-01-08 10:46:51 +01:00
Stephane Nicoll
06572b0101 Polish 2018-01-08 10:10:50 +01:00
Brian Clozel
2bf15f814e Polish
This commit fixes the `responseCommitted` test in
`DefaultErrorWebExceptionHandlerIntegrationTests` and reworks the whole
test class to use the `ContextRunner` infrastructure.

Fixes gh-11519
2018-01-05 18:55:13 +01:00
Stephane Nicoll
c4db22007c Polish "Add support for additional Kafka listener properties"
Closes gh-11502
2018-01-05 14:35:04 +01:00
Gary Russell
6fcbf80b31 Add support for additional Kafka listener properties
See gh-11502
2018-01-05 14:11:34 +01:00
Andy Wilkinson
94d5836618 Merge branch '1.5.x' 2018-01-05 12:02:11 +00:00