Skip to content

Instantly share code, notes, and snippets.

@niko-dunixi
Last active August 29, 2015 14:00
Show Gist options
  • Save niko-dunixi/11107774 to your computer and use it in GitHub Desktop.
Save niko-dunixi/11107774 to your computer and use it in GitHub Desktop.
Spring MVC response header for X-UA-Compatible: IE=edge,chrome=1
@RequestMapping(value = "/", method = RequestMethod.GET)
public String home(@RequestHeader("User-Agent") String userAgent, HttpServletResponse response) {
logger.info(userAgent);
if (userAgent.contains("MSIE")) {
logger.info("Adding response header for IE");
response.addHeader("X-UA-Compatible", "IE=edge,chrome=1");
}
return "home";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment