REST with encoded special character (ie. [ and ]) appear to give 400 error
Using version 9.1.0
I submit a REST GET request with the following where <lab's website> is our hostname:
https://<lab's website>/rest/util/generateGraphicImage?&productName=%5B%22GTG_00_CAT_010_CONUS%22%5D&airportIdentifier=PDX001100&radius=100&minRunwayLength=50&labelsOn=true&width=1000&height=800&renderSectionals=false&forecastHour=15&includeCodedMessages=true&versionRequested=20170327
I get a 400 error code and the following response:
Status:
code:400
protocol:HTTP/1.1
Headers:
vary:accept-encoding
Connection:close
Set-Cookie:TS016a7697=01cb0d81e0d79ca988cc0cdef12214c790e82ef9c176414e90428f6ea18fc090bf42f08924434dad78b64b1b0e37b244875f83498df74145ccbf670df61ac3f4974f55d9f3; Path=/
Date:Tue, 13 Apr 2021 19:10:59 GMT
Content-Language:en
Content-Type:text/html;charset=utf-8
Body:
<!doctype html><html lang="en"><head><title>HTTP Status 400 – Bad Request</title><style type="text/css">body {font-family:Tahoma,Arial,sans-serif;} h1, h2, h3, b {color:white;background-color:#525D76;} h1 {font-size:22px;} h2 {font-size:16px;} h3 {font-size:14px;} p {font-size:12px;} a {color:black;} .line {height:1px;background-color:#525D76;border:none;}</style></head><body><h1>HTTP Status 400 – Bad Request</h1><hr class="line" /><p><b>Type</b> Exception Report</p><p><b>Message</b> Invalid character found in the request target [/Website14/rest/util/generateGraphicImage?&productName=[%22GTG_00_CAT_010_CONUS%22]&airportIdentifier=PDX001100&radius=100&minRunwayLength=50&labelsOn=true&width=1000&height=800&renderSectionals=false&forecastHour=15&includeCodedMessages=true&versionRequested=20170327]. The valid characters are defined in RFC 7230 and RFC 3986</p><p><b>Description</b> The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing).</p><p><b>Exception</b></p><pre>java.lang.IllegalArgumentException: Invalid character found in the request target [/Website14/rest/util/generateGraphicImage?&productName=[%22GTG_00_CAT_010_CONUS%22]&airportIdentifier=PDX001100&radius=100&minRunwayLength=50&labelsOn=true&width=1000&height=800&renderSectionals=false&forecastHour=15&includeCodedMessages=true&versionRequested=20170327]. The valid characters are defined in RFC 7230 and RFC 3986
org.apache.coyote.http11.Http11InputBuffer.parseRequestLine(Http11InputBuffer.java:490)
org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:261)
org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:880)
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1601)
org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
java.base/java.lang.Thread.run(Thread.java:834)
</pre><p><b>Note</b> The full stack trace of the root cause is available in the server logs.</p><hr class="line" /><h3>Apache Tomcat</h3></body></html>
Please sign in to leave a comment.