use of com.genexus.servlet.http.IHttpServletResponse in project JavaClasses by genexuslabs.
the class CustomFilter method doFilter.
public void doFilter(IServletRequest request, IServletResponse response, IFilterChain chain) throws Exception {
if (request != null && request.isHttpServletRequest()) {
IHttpServletRequest req = request.getHttpServletRequest();
String url = req.getRequestURL().toString();
if (url.contains("apple-app-site-association")) {
IHttpServletResponse resp = response.getHttpServletResponse();
resp.setContentType("application/json");
}
}
// pass the request along the filter chain
chain.doFilter(request, response);
}
use of com.genexus.servlet.http.IHttpServletResponse in project JavaClasses by genexuslabs.
the class HttpContextWeb method flushStream.
public void flushStream() {
proxyCookieValues();
try {
if (buffered) {
// Esto en realidad cierra el ZipOutputStream, o el ByteOutputStream, no cierra
// el del
// servlet... Es necesario hacerlo, dado que sino el GZip no hace el flush de
// los datos
// que se grabaron al bytearray
closeOutputStream();
IHttpServletResponse response = getResponse();
if (buffer != null && !response.isCommitted()) {
IServletOutputStream stream = response.getOutputStream();
response.setContentLength(buffer.size());
buffer.writeToOutputStream(stream.getOutputStream());
stream.close();
}
} else {
closeOutputStream();
}
} catch (IOException e) {
log.error("Error flushing stream", e);
}
}
Aggregations