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.