You can't add anything to build-in server of H2. Just don't use it in
production.
If you're using a some other web server (Tomcat, Jetty, etc.) and H2
Console servlet on it, you can add a javax.servlet.Filter implementation
with @javax.servlet.annotation.WebFilter annotation and add all headers to
its doFilter() method. Don't forget to call chain.doFilter(…) from it.
You should also add a security constraint for H2 Console servlet to the
web.xml configuration file. Something like
<servlet>
<servlet-name>H2Console</servlet-name>
<servlet-class>org.h2.server.web.WebServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>H2Console</servlet-name>
<url-pattern>/h2-console/*</url-pattern>
</servlet-mapping>
<security-role>
<role-name>admin</role-name>
</security-role>
<security-constraint>
<web-resource-collection>
<web-resource-name>H2 Console</web-resource-name>
<url-pattern>/h2-console/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>admin</role-name>
</auth-constraint>
</security-constraint>
In this example a role admin needs to be defined on your web server, see
its documentation for details.
--
You received this message because you are subscribed to the Google Groups "H2
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/h2-database/41463683-7a86-4b23-bd8d-ada00eafed5en%40googlegroups.com.