Send HTTP 408 on idle timeout

This commit is contained in:
Chris Eager authored and Chris Eager committed 2023-11-20 16:24:54 -06:00
1 parent e04b5e5c9f
commit d6ade0e1ac
1 file changed
+3
@@ -21,7 +21,10 @@ public class IOExceptionMapper implements ExceptionMapper<IOException> {
public Response toResponse(IOException e) {
if (!(e.getCause() instanceof java.util.concurrent.TimeoutException)) {
logger.warn("IOExceptionMapper", e);
} else if (e.getCause().getMessage().startsWith("Idle timeout expired")) {
return Response.status(Response.Status.REQUEST_TIMEOUT).build();
}
return Response.status(503).build();
}
}