1. 22 11月, 2019 1 次提交
    • R
      Improve HttpHandlerConnection completion · 21b2fc1f
      Rossen Stoyanchev 提交于
      Before this commit the connector waited for a completed response (via
      ServerHttpResponse#setComplete or ServerHttpResponse#writeWith) or an
      error signal in handling, but it didn't deal explicitly with the case
      where both can occur.
      
      This commit explicitly waits for the completion of handling (success
      or error) before passing the response downstream. If an error occurs
      after response completion, it is wrapped in a dedicated exception that
      also provides access to the completed response.
      
      Close gh-24051
      21b2fc1f
  2. 24 9月, 2019 1 次提交
  3. 16 9月, 2019 1 次提交
  4. 31 7月, 2019 1 次提交
  5. 30 7月, 2019 1 次提交
    • A
      Add support for non-standard status codes · 29ef9854
      Arjen Poutsma 提交于
      Added support for status codes that do not occur in HttpStatus in
      DefaultClientResponseBuilder and made ClientResponse::statusCode
      ClientHttpResponse::getStatusCode @Nullable.
      
      Closed gh-23366
      29ef9854
  6. 23 3月, 2019 1 次提交
  7. 22 3月, 2019 1 次提交
  8. 28 6月, 2018 1 次提交
  9. 28 4月, 2018 1 次提交
  10. 01 11月, 2017 1 次提交
  11. 28 9月, 2017 1 次提交
    • B
      Fix behavior of ClientResponse#bodyTo** with Void · 126ac849
      Brian Clozel 提交于
      Prior to this commit, asking for a `Void` type using any of the
      `ClientResponse#bodyTo*` methods would immediately return an empty
      `Publisher` without consuming the response body.
      
      Not doing so can lead to HTTP connection pool inconsistencies and/or
      memory leaks, since:
      
      * a connection that still has a response body being written to it cannot
      be properly recycled in the connection pool
      * incoming `DataBuffer` might not be released
      
      This commit detects when `Void` types are asked as body types and in
      those cases does the following:
      
      1. Subscribe to the response body `Publisher` to allow the connection to
      be returned to the connection pool
      2. `cancel()` the body `Publisher` if the response body is not empty; in
      that case, we choose to close the connection vs. consume the whole
      response body
      
      Those changes imply that `ClientHttpResponse` and other related
      contracts don't need a `close()` method anymore.
      
      Issue: SPR-16018
      126ac849
  12. 06 9月, 2017 1 次提交
    • B
      Add close() method on HTTP client response · 16f3f8d2
      Brian Clozel 提交于
      Before this commit, there was no way to signal the HTTP client that we
      were done consuming the response. Without that, the underlying client
      library cannot know when it is safe to release the associated resources
      (e.g. the HTTP connection).
      
      This commit adds new `close()` methods on both `ClientHttpResponse`
      and `ClientResponse`. This methods is non-blocking and its behavior
      depends on the library, its configuration, HTTP version, etc.
      
      At the `WebClient` level, `close()` is called automatically if we
      consume the response body through the `ResponseSpec` or the
      `ClientResponse` itself.
      
      Note that it is *required* to call `close()` manually otherwise; not
      doing so might create resource leaks or connection issues.
      
      Issue: SPR-15920
      16f3f8d2
  13. 14 1月, 2017 1 次提交
    • R
      Refactor reactive mock request and response support · ba3cc535
      Rossen Stoyanchev 提交于
      MockServerHttpRequest and MockServerHttpResponse now extend the same
      abstract base classes that server-specific implementations do and
      therefore approximate their behavior more closely.
      
      As an immediate consequence MockServerHttpRequest is read-only after
      it is created. Instead it now exposes static builder methods similar
      to those found in RequestEntity. This enforces more strictness as well
      as recycling of requests in tests and provides nicer builder methods.
      
      To simplify tests DefaultServerWebExchange now offers a constructor
      with just a request and response, and automatically creating a
      DefaultWebSessionManager.
      
      The spring-test module now also contains client-side reactive mock
      request and response implementations. The mock client request extends
      the same AbstractClientHttpRequest as client-specific implementations
      do. There is no abstract base class for client responses.
      
      Issue: SPR-14590
      ba3cc535
  14. 21 9月, 2016 1 次提交
  15. 03 9月, 2016 4 次提交
  16. 21 7月, 2016 1 次提交
  17. 15 7月, 2016 1 次提交
  18. 05 7月, 2016 1 次提交
  19. 04 7月, 2016 1 次提交
    • S
      Avoid exception while setting the status code of a committed response · c1518c3f
      Sebastien Deleuze 提交于
      Before this commit, it was not possible to set the status code of an
      HTTP response without throwing an exception if it was already
      committed. The consequence was a lot of errors in the logs for long
      lived HTTP exchanges like Server-Sent Events for example.
      
      After this commit, ServerHttpResponse#setStatusCode() returns
      true if the operation succeeded and false if the status code has not
      been set because the response has already been committed.
      
      In term of implementation, that makes status code managed
      consistently with headers and cookies:
      AbstractServerHttpResponse#setStatusCode() stores the status
      code that will be effectively set later in the response lifecycle by
      the HTTP server via AbstractServerHttpResponse#writeStatusCode()
      when the response will be committed.
      c1518c3f
  20. 01 7月, 2016 1 次提交
  21. 30 5月, 2016 1 次提交
  22. 27 5月, 2016 2 次提交
  23. 28 4月, 2016 1 次提交
  24. 18 3月, 2016 2 次提交
  25. 04 3月, 2016 1 次提交
    • R
      Refactor HTTP Cookie support · dbc6478b
      Rossen Stoyanchev 提交于
      There is now an HttpCookie (simple name-value pair) and separately a
      ServerHttpCookie sub-class with additional attributes that a server
      can send to clients.
      
      HttpHeaders is no longer the place to access cookies. Instead there is
      a read-only HttpCookie map on ServerHttpRequest and a mutable
      ServerHttpCookie map on ServerHttpResponse.
      
      Cookies are stored in a map that preserves their order.
      dbc6478b
  26. 09 2月, 2016 1 次提交
  27. 28 1月, 2016 1 次提交
    • R
      Add setComplete + beforeCommit to ServerHttpResponse · 3744549a
      Rossen Stoyanchev 提交于
      setComplete replaces writeHeaders as a more general lifecycle method
      to perform any kind of handling at the end of request processing, for
      example to ensure headers are written if not already.
      
      beforeCommit provides an extension point for an action to be invoked
      just before the response is committed, e.g. adding headers/cookies.
      3744549a
  28. 27 1月, 2016 1 次提交
  29. 20 1月, 2016 1 次提交
    • S
      demote cyclic dependency under reactor-core reactor package · 198e3164
      Stephane Maldini 提交于
      -> reactor.Mono : reactor.core.publisher.Mono
      -> reactor.Flux : reactor.core.publisher.Flux
      -> reactor.Processors : reactor.core.publisher.Processors
      -> reactor.Timers : reactor.core.timer.Timers
      -> reactor.Subscribers : reactor.core.subscriber.Subscribers
      198e3164
  30. 10 1月, 2016 1 次提交
    • R
      Re-introduce writeHeaders() in ServerHttpResponse · eedc9081
      Rossen Stoyanchev 提交于
      This commit brings back the writeHeaders method on ServerHttpResponse
      that was once added (2a6a4f) and then removed (9c7151).
      
      This version is a little simpler since writeHeaders doesn't explicitly
      flush/send headers which runtimes are expected to do by default.
      Instead the main purpose of writeHeaders now is to ensure changes made
      via HttpHeaders are applied to the underlying runtime response at some
      point and we now do that once at the very end.
      
      This approach provides the most flexibility (vs keeping HttpHeaders in
      sync) because it allows a full and consistent set of mutative
      operations for both headers and cookies (to be added) regardless of the
      API exposed by the underlying runtime.
      eedc9081
  31. 07 1月, 2016 1 次提交
    • S
      Use Reactor 2.5 Flux and Mono Rx light API · 8ef7e2ff
      Sebastien Deleuze 提交于
      Flux and Mono are used both for implementation and exposed at API
      level to express 1 versus N semantic and to provide default Rx
      operators:
      - Flux<T> for multiple values Publisher (issue #48)
      - Mono<T> for single value Publisher (issue #50)
      - Mono<Void> for Publisher with no value (issue #49)
      8ef7e2ff
  32. 30 12月, 2015 1 次提交
    • R
      Response headers always in sync with native response · 6b05d172
      Rossen Stoyanchev 提交于
      ServerHttpResponse implementations now immediately propagate
      HttpHeaders changes as they so there is no need to call applyHeaders().
      
      The writeHeaders from ServerHttpResponse is also removed. RxNetty and
      Reactor Net both support implicitly completing if the handler
      completes without explicitly writing the headers or the response body.
      6b05d172
  33. 11 12月, 2015 2 次提交
  34. 09 12月, 2015 1 次提交