Commit Graph

15752 Commits

Author SHA1 Message Date
Juergen Hoeller
0ef117ff11 Upgrade to Tomcat 8.5.24 and Jetty 9.4.8 2017-12-03 16:03:02 +01:00
Rossen Stoyanchev
fda08852ba Take content-type from ResponseEntity unconditionally
From #9a894a we began using the content-type from the ResponseEntity
but cross-checking it still against the requested content type.

Arguably there isn't any purpose in cross-checking. The only possible
outcomes are: a) it's compatible or b) it's not, which would result in
406 (NOT_ACCEPTABLE). As we've been given explicitly the media type to
use, it makes little sense to send 406, ignoring the wish to use that
content type.

Issue: SPR-16251
2017-12-02 00:43:43 -05:00
Rossen Stoyanchev
203370a810 Handle absolute URI in Reactor request.uri()
The request URI returned from HttpServerRequest.uri() typically
contains contains an absolute path but could also contain an
absolute URI. This commit adds handling for the latter, effectively
taking only the absolute path portion.

Issue: SPR-16243
2017-12-01 23:34:35 -05:00
Rossen Stoyanchev
b9a1168580 Consistently return null if certificates not available
Issue: SPR-16244
2017-12-01 21:38:40 -05:00
Rossen Stoyanchev
e99b0038a0 Polish 2017-12-01 21:18:13 -05:00
Rossen Stoyanchev
91d3e4402f Add test case for SPR-16246 2017-12-01 15:40:35 -05:00
Rossen Stoyanchev
44c95a4736 Adjust logging to catch sporadic PERF build failure 2017-12-01 10:11:51 -05:00
sdeleuze
7368f58518 Upgrade to Kotlin 1.2
apiVersion and languageVersion options are set to 1.1
on production code in order to avoid incompatibilities
with Kotlin 1.1 based projects or libraries.

Issue: SPR-16239
2017-11-30 14:50:16 +01:00
Rossen Stoyanchev
63c2c08e01 Update advice on file extensions in URLs
Issue: SPR-16240
2017-11-29 15:09:13 -05:00
Rossen Stoyanchev
dd0d270ba2 Improve error handling when response is committed
ResponseStatusExceptionHandler lets the error through if it can't
change the status while HttpWebHandlerAdapter logs a more helpful
message (including status code) but without a full stack trace.

Issue: SPR-16231
2017-11-29 12:39:06 -05:00
Juergen Hoeller
873cb4e58b Remove unnecessary deprecation suppression 2017-11-29 15:44:08 +01:00
Juergen Hoeller
b55a2631ba NamedParameterJdbcTemplate provides accessor for classic JdbcTemplate
Issue: SPR-16241
2017-11-29 15:38:21 +01:00
Rossen Stoyanchev
6f73b8b200 Add WebTestClient to Web Servlet section 2017-11-29 08:45:07 -05:00
Sam Brannen
2b68212c20 Fix grammar 2017-11-29 14:44:21 +01:00
Rossen Stoyanchev
3650ecc3bb Polish 2017-11-28 22:16:07 -05:00
Rossen Stoyanchev
bec63fbb33 Update CORS chapters
- Add "Processing" section (also replaces Advanced Customizations)
- Add information on out-of-the-box behavior
- Add more deails on @CrossOririn default configuratio
- Add cross-references between Spring MVC and WebFlux
- Polish
2017-11-28 16:29:30 -05:00
Rossen Stoyanchev
375a63a041 Update README.md 2017-11-28 09:28:34 -05:00
Sam Brannen
773cd3241b Polishing 2017-11-28 14:11:21 +01:00
Juergen Hoeller
f2e8171bfb Latest dependency updates (RxJava 2.1.7, TestNG 6.13.1, Selenium HtmlUnit Driver 2.28.2) 2017-11-28 12:10:26 +01:00
Rossen Stoyanchev
dc3d834026 Refinements related to a committed response
1. setComplete checks the isCommitted flag to avoid an unnecessary
debug message. This method is meant to be safe to call many times.

2. setStatusCode lowers log message to TRACE, since the return value
communicates the outcome it's arguably much less critical.

3. Add comment and test case for ResponseStatusExceptionHandler.
A ResponseStatusException is clearly meant to be handled by this
handler so don't let it pass through even if the respones is
committed.

Issue: SPR-16231
2017-11-27 16:31:49 -05:00
Spring Buildmaster
e30f1fbe89 Next Development Version 2017-11-27 10:52:28 +00:00
Juergen Hoeller
b1c657fa4b Consistent nullability in DataAccessUtils through nullableSingleResult
Issue: SPR-16225
2017-11-26 17:16:39 +01:00
Juergen Hoeller
a8323f6a27 Latest dependency updates (OkHttp 3.9.1, JRuby 9.1.14, Rome 1.9) 2017-11-26 16:03:48 +01:00
Juergen Hoeller
81052cd27a Upgrade to Kotlin 1.1.61
Issue: SPR-16194
2017-11-24 23:23:38 +01:00
Juergen Hoeller
35dd8db892 Correct number of web-specific scopes
Issue: SPR-16230
2017-11-24 14:13:23 +01:00
Juergen Hoeller
edf22a3e25 Upgrade to Log4J 2.10 (and Groovy 2.4.13) 2017-11-24 12:04:08 +01:00
sdeleuze
3b96690e69 Add missing RestOperations extensions
Issue: SPR-16229
2017-11-23 22:12:03 +01:00
Rossen Stoyanchev
01a82b5291 Improve semantics writing currentData
Before this commit, the return value from write was interpreted as the
data being fully written and ready to be released via releaseData().

This is not true for WebSocketSession implementations where a true
return value simply means the message was sent with the full payload
but releas is not appropriate until a send confirmation.

Technically not an issue since WebSocketSession's extending this do
not use pooled buffers. Nevertheless this commit refines the semantics
of write, removes the releaseData() method, and makes sub-classes
responsible for releasing the buffer when fully written (and they
know best when that is). As a bonus currentData is now private.

Issue: SPR-16207
2017-11-23 10:55:03 -05:00
Rossen Stoyanchev
102a0ad792 Polish 2017-11-23 10:22:35 -05:00
Rossen Stoyanchev
c1b191edb0 Polish and improve logging 2017-11-22 23:25:36 -05:00
Rossen Stoyanchev
f44366877c Switch to suspended mode before demand
After this commit, Tomcat and Undertow WebSocketSession imlpementations
start out in suspended mode and wait for demand.

The JettyWebSocketSession is capable of suspending but it doesn't seem
to work if invoked before any messages are received. That may become an
issue if there is a case where no demand appears long enough for more
messages to accumulate than we can hold.

UnderowServerHttpRequest would ideally also start in suspended mode but
that also doesn't work. It is not an issue in this case since we can
ignore the read notifications.

Servlet API requires a proactive check before it calls you back so
there is no need to suspend.

Issue: SPR-16207
2017-11-22 17:55:20 -05:00
Rossen Stoyanchev
afdca285e5 Avoid resume-suspend race condition
This commit turns suspendReading() into a readingPaused() notification
that is invoked after a succession of reads stops because there is no
more demand. Sub-classes can use this notification to suspend, if that
applies to them.

Most importantly the notification is guaranteed not to overlap with
checkOnDataAvailable() which means that suspend does not need to be
atomic and guarded against resume. The two can and do compete all the
time when reading ends with no demand, and a request for demand arrives
concurrently.

Issue: SPR-16207
2017-11-22 17:48:03 -05:00
sdeleuze
4a87d3da7b Set Vary: Origin on CORS unauthorized response
Issue: SPR-16224
2017-11-22 22:46:53 +01:00
sdeleuze
652e5c5584 Disable CORS credentials by default
Access-Control-Allow-Credentials CORS header, used to
allow cookies with CORS requests, is not set to true
anymore by default when enabling CORS with
@CrossOrigin or global CORS configuration in order to
provide a more secured default CORS configuration.

The related allowCredentials property now requires to
be set to true explicitly in order to support cookies
with CORS requests.

Issue: SPR-16130
2017-11-22 22:46:44 +01:00
Juergen Hoeller
93f17dae47 Log4jLog explicitly passes String argument (avoiding argument expansion)
Issue: SPR-16226
2017-11-22 21:13:39 +01:00
Rossen Stoyanchev
b7c924cac1 Polish 2017-11-21 23:20:13 -05:00
Violeta Georgieva
d8099adc9a AbstractListenerWebSocketSession: suspend the channel when there is no demand
Issues: SPR-16207
2017-11-21 22:59:33 -05:00
Rossen Stoyanchev
06b2ab3908 Use volatile for subscriber in base publishers
Issue: SPR-16207
2017-11-21 22:57:15 -05:00
Rossen Stoyanchev
b89a48a703 Improve FlushingIntegrationTests 2017-11-21 22:12:33 -05:00
Rossen Stoyanchev
3c2d1862f1 Light refactoring/polish in reactive read/write bridge
Issue: SPR-16207
2017-11-21 21:46:30 -05:00
Violeta Georgieva
2a481c5411 Fix race conditions in AbstractListenerReadPublisher
Transition from DEMAND->NO_DEMAND:
Two concurrent threads enter DEMAND.request and DEMAND.onDataAvailable.
And DEMAND.onDataAvailable finishes before DEMAND.request to be able to
update the demand field then a request for reading will be lost.

Transition from READING->NO_DEMAND:
readAndPublish() returns false because there is no demand but before
switching the states READING.request is invoked again a request for
reading will be lost.

Changing READING->DEMAND/NO_DEMAND is made conditional so that the
operations will be executed only if changing states succeeds.

When in READING state detect completion before each next item in order
to exit sooner, if completed.

Issue: SPR-16207
2017-11-21 14:44:46 -05:00
Violeta Georgieva
b814875211 Fix race condition in transition from UNSUBSCRIBED->COMPLETED
- Ensure completion signal (normal/exception) will be delivered to
the subscriber when transition from UNSUBSCRIBED->COMPLETED

- According to the specification "Publisher.subscribe MUST call onSubscribe
on the provided Subscriber prior to any other signals to that Subscriber" so
ensure onComplete/onError signals will be called AFTER onSubscribe signal.

Issue: SPR-16207
2017-11-21 14:44:01 -05:00
Violeta Georgieva
41b13a4e8a Ensure onComplete/onError events will be delivered
Issue: SPR-16207
2017-11-21 14:42:05 -05:00
Juergen Hoeller
604017894e Upgrade to Tiles 3.0.8 (and Selenium HtmlUnit Driver 2.28.1) 2017-11-21 17:56:42 +01:00
Juergen Hoeller
0cc644f61f Polishing 2017-11-21 16:34:08 +01:00
sdeleuze
9f1d8517ba Polish Kotlin source code style 2017-11-21 15:59:23 +01:00
Juergen Hoeller
5843173567 Polishing 2017-11-21 13:42:57 +01:00
Juergen Hoeller
08c95fbcb3 Unit tests for configuration superclass inclusion
Issue: SPR-16217
2017-11-21 13:42:01 +01:00
Stephane Nicoll
bdb04b1d28 Merge pull request #1601 from hongxingwz:master
* pr/1601:
  Fix copy/paste in Javadoc
2017-11-21 06:58:45 +01:00
jianglei
4b614dc1de Fix copy/paste in Javadoc
Closes gh-1601
2017-11-21 06:58:14 +01:00