I am progressively refactoring some old code (so issues is on my side) but I found a strange behavior: sometimes, it seems that spark keep a previously assigned response code as in
response.status(500);
... do something
response.status(200);
return something
may returns an empty message and an error status 500.
I compiled with version 2.8.0 and still faced this issue.
Why is that? latest status code shall be the correct one.
For instance, having a per default code to 200 and then assigning another code in case of failure would be a "correct" setup but because of the above, code 200 may still be returned when an error occurred.
Note : I faced this behavior at least when response.status() is called two times in same function.
Good afternoon.
I am progressively refactoring some old code (so issues is on my side) but I found a strange behavior: sometimes, it seems that spark keep a previously assigned response code as in
may returns an empty message and an error status 500.
I compiled with version 2.8.0 and still faced this issue. Why is that? latest status code shall be the correct one.
For instance, having a per default code to 200 and then assigning another code in case of failure would be a "correct" setup but because of the above, code 200 may still be returned when an error occurred.
Note : I faced this behavior at least when response.status() is called two times in same function.