Bug 64666 - Cannot allow special characters in query strings without replacing server.xml
Summary: Cannot allow special characters in query strings without replacing server.xml
Alias: None
Product: Tomcat 8
Classification: Unclassified
Component: Connectors (show other bugs)
Version: 8.5.x-trunk
Hardware: PC Mac OS X 10.1
: P2 normal (vote)
Target Milestone: ----
Assignee: Tomcat Developers Mailing List
Depends on:
Reported: 2020-08-13 09:58 UTC by Franck Mangin
Modified: 2020-08-14 18:01 UTC (History)
0 users


Note You need to log in before you can comment on or make changes to this bug.
Description Franck Mangin 2020-08-13 09:58:42 UTC
Square brackets can be allowed in query strings using this configuration in server.xml:
    <Connector port="8080" protocol="HTTP/1.1"
               relaxedQueryChars="[]" />

In a docker image based on the standard tomcat85 base image however, this forces us to entirely replace the base server.xml.

A system property or some other means of configuring this without modifying server.xml would be very useful.
Comment 1 Michael Osipov 2020-08-13 10:27:23 UTC
I am rejecting this because a system property will affect the entire container, not just this connector. Moreover, RFC 3986 does not allow [ or ] in a query string w/o pct-encoded because both chars are in gen-delims and not in pchar.
Comment 2 Felix Schumacher 2020-08-14 18:01:49 UTC
Maybe you can achieve the same using a PropertySource and lookup your values from environment variables. See https://tomcat.apache.org/tomcat-8.5-doc/config/systemprops.html#Property_replacements and https://tomcat.apache.org/tomcat-9.0-doc/api/org/apache/tomcat/util/digester/EnvironmentPropertySource.html for more information