Announcement Announcement Module
Collapse
No announcement yet.
Bug in Spring 3.1.1 RestTemplate Class in retrieving response Buffer on 401 error Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Bug in Spring 3.1.1 RestTemplate Class in retrieving response Buffer on 401 error

    I have a RESTful web server implemented with custom authentication and returns 401 plus a JSON response when authentication fails. When the authentication fails as on a GET, all is well and RestTemplate returns back both the status code as well as the JSON response but when we send a POST, the body gets lost. We see that an HttpRetryException is getting called when attempting to retrieve the responseBody. This is in function getResponseBody in DefaultResponseErrorHandler. I assume this means that the response is already retrieved at an earlier point and therefore gets lost.

  • #2
    The reason for the difference between GET and PUT is the field doOutput. In the case of the POST it is set to true so the output is read in earlier, in the executeInternal function (SimpleBufferingClientHttpRequest). So, i am not sure what the fix is but i am definitely sure that it is not intended behavior here

    Comment


    • #3
      Is the proper protocol to open a JIRA for this issue?

      Comment


      • #4
        Hi, I can confirm that the same issue is in spring framework 3.1.2 release. A JIRA ticket is created to track the issue:
        https://jira.springsource.org/browse/SPR-9999

        Comment

        Working...
        X