I have a RESTful service written in Java/Spring. In this service, I have 3 @ExceptionHandler methods, all of which return null. Only one exception sets the status to 409 Conflict, which is the one I'm expecting in my current scenario.
While testing the service with Postman on localhost, under a particular circumstance, I get an expected 409 Conflict with no data body. However, when I hit the service after being deployed on amazonaws.com, I get the 409 Conflict with a result body consisting of timestamp, status, error, exception, and message values. The version returned by /manage/info looks correct and the git commit data is reported exactly the same.
The localhost version returns 4 headers (plus a custom one):
- Content-Length = 0
- Date = (today)
- Server = Apache-Coyote/1.1
- X-Application-Context = application
The Amazon AWS version returns 5 headers (plus the same custom one):
- Content-Type = application/json;charset=UTF-8
- Date = (today)
- Server = Apache-Coyote/1.1
- Transfer-Encoding = chunked
- X-Application-Content = application, application
What could be causing this? My application calling the service ~could~ handle either situation, but it seems wrong to bandage a fix there when obviously something weird is going on in the service, itself. It was coded to expect null, not a body consisting of values that would not be part of a non-409 result.
Aucun commentaire:
Enregistrer un commentaire