0

I have two seperate servers running tomcat 9 and tomcat 8 respectively. When I sent a http request to tomcat 9 where one of the parameters has a '[' character in it the request is handled fine by tomcat and forwarded to the correct servlet. However, when I send the same request to tomcat 8 server a 400 error is thrown without the request even getting to the processing servlet The only log I can see when the request fails is in tomcats access log which reads 127.0.0.1 - - [30/Jan/2019:22:53:45 +0000] "GET null null" 400 -

Clearly the problem is with tomcat 8 and how it handles this character. Question is what is the difference in default configuration between 9 and 8 because tomcat 9 is setup in a default configuration as is tomcat 8. And updating tomcat 8 is NOT an option as it is a customers server who is not for changing.

I have read answers such as Tomcat 8 is not able to handle get request with '|' in query parameters? and escaping the characters would be a good solution but I am trying to see "where" can I intercept the request in order to escape the characters

MayoMan
  • 4,757
  • 10
  • 53
  • 85
  • Why does the parameter have a [ character in it? It should be encoded at source. – user207421 Jan 30 '19 at 23:31
  • our current solution works as I said on tomcat 9.0. There can be no changes made at this stage to the client side front end or the version of tomcat 8 being used on the server side. As a last resort perhaps so that is why I am trying to find a way round this without resorting to an update of tomcat or even worse having to push out client side changes to encode these characters – MayoMan Jan 31 '19 at 00:21
  • In the answers you mentionned, they give some configurations to solve that kind of problems. Did you try them ? – Eugène Adell Jan 31 '19 at 08:28
  • yes, added the '[' character as per " relaxedQueryChars="[,]" " but it doesn't seem to make any difference. Is it possible to call into tomcat to get a logout of its current live configuration. I didnt make the change myself , did via a technical support guy on the customers site and not sure it done properly :( – MayoMan Jan 31 '19 at 08:38
  • One Filter writes all the properties in the log, but in your case it's not a property but a config attribute. I don't have any answer but activate JMX and start a JConsole to see the connector configuration. – Eugène Adell Jan 31 '19 at 10:02
  • This may be useful. https://stackoverflow.com/questions/41053653/tomcat-8-is-not-able-to-handle-get-request-with-in-query-parameters – Nirmal Mangal Jul 29 '19 at 22:06

0 Answers0