javatomcatinternet-explorer-11bad-requeststruts1

IE11: Error 400 only on specific server


I am getting a Bad request error on IE11:

The error only occurs using IE11, with Firefox or Chrome it works. And only in that specific environment. It works in DEV environment with Tomcat 8.5. It also works in the old prod/preprod/dev servers with Websphere 6.1. I could not reproduce it locally, not even changing the Tomcat 8 URIEncoding connector parameter.

Did something similar happen to anyone? Just for now, a workaround I found was to use Javascript encodeURI function before triggering the window.open, but I am looking for the real reason that makes this fail ONLY on that specific server.

I tried changing the IE international settings to encode URLs and adding the site to my secure sites, but the error persists.


Solution

  • I found what was happenning: the DEV server and Preprod server were slighty different, DEV had Tomcat 8.5.3, Preprod had Tomcat 8.5.9, in that version there are some restrictions with the characters in a URI, Firefox and Chrome encode them before sending to the server (that's why it does not fail in those browsers), IE sends them as they come (even specifying in the options to encode URLs). So, for IE it is needed to encode them with javascript before sending the request.