Alexander Wels has posted comments on this change. Change subject: engine: Add header to each response. ......................................................................
Patch Set 2: (3 comments) http://gerrit.ovirt.org/#/c/25937/2/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/servlet/HeaderFilter.java File backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/servlet/HeaderFilter.java: Line 90: HttpServletResponse res = (HttpServletResponse) response; Line 91: for (Map.Entry<String, String> entry: headerValueMap.entrySet()) { Line 92: res.addHeader(entry.getKey(), entry.getValue()); Line 93: } Line 94: chain.doFilter(request, response); > don't you need to set header after doFilter to override whatever applicatio No I have to do them before the chain, as the servlet will commit the response at which point I can't add anything anymore. The servlet can't really remove the headers just add new ones. Line 95: } Line 96: Line 97: @Override Line 98: public void init(FilterConfig filterConfig) throws ServletException { http://gerrit.ovirt.org/#/c/25937/2/backend/manager/modules/welcome/src/main/webapp/WEB-INF/web.xml File backend/manager/modules/welcome/src/main/webapp/WEB-INF/web.xml: Line 81: Line 82: <filter-mapping> Line 83: <filter-name>HeaderFilter</filter-name> Line 84: <url-pattern>/*</url-pattern> Line 85: </filter-mapping> > is there ordering in filters? how can be know that this filter is installed There is no relationship between those filters, and thus the order doesn't matter at all. But yes the order in web.xml determines the other of the filters in the filter chain. But it doesn't matter in this case. Line 86: Line 87: <filter-mapping> Line 88: <filter-name>LocaleFilter</filter-name> Line 89: <url-pattern>/*</url-pattern> http://gerrit.ovirt.org/#/c/25937/2/frontend/webadmin/modules/webadmin/src/main/webapp/WEB-INF/web.xml File frontend/webadmin/modules/webadmin/src/main/webapp/WEB-INF/web.xml: Line 62: Line 63: <filter-mapping> Line 64: <filter-name>HeaderFilter</filter-name> Line 65: <url-pattern>/*</url-pattern> Line 66: </filter-mapping> > use tabs as rest of entries? submit patch to reformat web.xml before this o Only some of the other entries use tabs, we can definitely create a new patch to reformat this. Line 67: Line 68: <servlet-mapping> Line 69: <servlet-name>WebAdminHostPageServlet</servlet-name> Line 70: <url-pattern>/WebAdmin.html</url-pattern> -- To view, visit http://gerrit.ovirt.org/25937 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4e9c26dddd0d0300d6b3d078ae763b78600f25d1 Gerrit-PatchSet: 2 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Alexander Wels <[email protected]> Gerrit-Reviewer: Alexander Wels <[email protected]> Gerrit-Reviewer: Alon Bar-Lev <[email protected]> Gerrit-Reviewer: Einav Cohen <[email protected]> Gerrit-Reviewer: [email protected] Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: Yes _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
