Do not set response status in ServerHttpObservationFilter
Prior to this commit, the `ServerHttpObservationFilter` would set the response status (and possibly overwrite it) in case an exception is found as an attribute. While the exception itself should be used in the observation, the filter should have no side effect on the response. Fixes gh-29353
This commit is contained in:
@@ -70,7 +70,7 @@ class ServerHttpObservationFilterTests {
|
||||
ServerRequestObservationContext context = (ServerRequestObservationContext) this.request
|
||||
.getAttribute(ServerHttpObservationFilter.CURRENT_OBSERVATION_CONTEXT_ATTRIBUTE);
|
||||
assertThat(context.getError()).isEqualTo(customError);
|
||||
assertThatHttpObservation().hasLowCardinalityKeyValue("outcome", "SERVER_ERROR");
|
||||
assertThatHttpObservation().hasLowCardinalityKeyValue("exception", "IllegalArgumentException");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user