-
Bug
-
Resolution: Done
-
Blocker
-
3.6.1.Final
-
None
-
None
If ServletInputStream readListener onError resumes exception, server returns HTTP 200
Priority of this jira is blocker, because this is a regression against RESTEasy 3.5.1 and RESTEasy 3.0.24 (used in WF11)
see this example:
@Path("")
public class ResourceInfoInjectionResource {
@Context
private HttpServletRequest request;
@POST
@Path("a")
public void a(@Suspended final AsyncResponse async) throws IOException {
final ServletInputStream inputStream = request.getInputStream();
inputStream.setReadListener(new ReadListener() {
@Override
public void onDataAvailable() throws IOException {
throw new java.lang.IllegalStateException("a exception");
}
@Override
public void onAllDataRead() throws IOException {
}
@Override
public void onError(Throwable t) {
async.resume(t);
}
});
}
@GET
@Path("/b")
public void b(@Suspended final AsyncResponse response) {
new Thread() {
public void run() {
try {
Thread.sleep(5000);
response.resume(new IllegalStateException("b exception"));
} catch (Exception e) {
throw new RuntimeException(e);
}
}
}.start();
}
}
- curl -v --data "aaa" -X POST -H "Content-Type: text/plain" http://127.0.0.1:8080/jaxrs-wf/a
- curl -v -X GET -H "Content-Type: text/plain" http://127.0.0.1:8080/jaxrs-wf/b
"b" end-point works correctly (returns 500), "a" end-point doesn't (returns 200)
- clones
-
JBEAP-15519 If ServletInputStream readListener onError resumes exception, server returns HTTP 200
-
- Closed
-