Ignasi Barrera created GUACAMOLE-385:
----------------------------------------
Summary: Add a convenience filter to cache the contents of HTTP
requests
Key: GUACAMOLE-385
URL: https://issues.apache.org/jira/browse/GUACAMOLE-385
Project: Guacamole
Issue Type: Improvement
Components: guacamole-common
Affects Versions: 0.9.13-incubating
Environment: Apache Tomcat >= 7
Servlet 3.0
Reporter: Ignasi Barrera
Some implementations of the HTTP servlet request do not allow a free use of the
{{getInputStream()}} and {{getParameter()}} methods. This is especially
annoying in Apache Tomcat >= 7 and Servlet 3.0, where invoking the
{{getParameter()}} method consumes the {{InputStream}} (making later uses of it
fail) and consuming the InputStream makes later {{getParameter()}} calls fail
to find the parameters, as the request body has been consumed.
This causes issues for tunnel servlets that need to access the request
parameters, commonly used to pass authentication tokens or additional info
provided in the {{tunnel.connect()}} call, as the tunnel needs later access to
the request input stream. Applications using the popular Spring framework may
be affected too, since some of its common filters also access the request
parameters.
If the request parameters are accessed in the tunnel servlet or a previous
filter, the {{doWrite}} method in the base HTTP tunnel servlet always gets an
already consumed {{InputStream}} and does not write anything to the socket,
causing an eventual timeout in the client.
This is related to: [GUAC-1252|https://glyptodon.org/jira/browse/GUAC-1252],
but none of the solutions there fix the issue in Tomcat 7 nor the existing
workarounds found in StackOverflow and the referenced threads.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)