check if response is already committed on error

master
lucio.lelii 3 years ago
parent 47f09fe3a5
commit bc1f02cdb5

@ -2,6 +2,11 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
# Changelog for Common Smartgears
## [v3.0.2] - 2020-03-01
- check if response is already committed on error
## [v3.0.1] - 2020-11-18
- new Uma Token integration

@ -11,7 +11,7 @@
<groupId>org.gcube.core</groupId>
<artifactId>common-smartgears</artifactId>
<version>3.0.1</version>
<version>3.0.2-SNAPSHOT</version>
<name>SmartGears</name>
<dependencyManagement>

@ -98,7 +98,7 @@ public class RequestManager implements Filter {
// dispatch to other filters for this servlet
chain.doFilter(request, response);
}catch(ServletException t){
log.error("error in doFilter",t.getRootCause());
log.error("error in doFilter",t);
handleError(httprequest,httpresponse,t.getRootCause());
}
@ -260,7 +260,8 @@ public class RequestManager implements Filter {
RequestException.class.cast(t).error():
application_error;
response.resetBuffer();
if (!response.isCommitted())
response.resetBuffer();
if (error == request_not_authorized_error){
response.setHeader("WWW-Authenticate", "Basic realm=\"Smartgears\"");
log.info("setting WWW-Authenticate to response header");

Loading…
Cancel
Save