DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUGĀ· RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT <http://issues.apache.org/bugzilla/show_bug.cgi?id=37285>. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED ANDĀ· INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=37285 Summary: POST of document through CGI Product: Tomcat 5 Version: 5.5.12 Platform: All OS/Version: Linux Status: NEW Severity: major Priority: P2 Component: Servlets:CGI AssignedTo: tomcat-dev@jakarta.apache.org ReportedBy: [EMAIL PROTECTED] If an XML document is posted through CGI the CGIServlet is prepending the content with the query parameters from the URL. Since the content is expected to be well formed XML (as specified by specifying "Content-Type: text/xml") the prepended query parameters cause the XML parsing to fail. Assuming a test.sh script has been configured for Tomcat which contains: java test <&0 >test.out where test.java simply echoes the input (there is probably an easier way to do this) as follows: public class test { public static void main(String[] args) { try { int c = System.in.read(); while(c > 0) { System.out.print((char)c); c = System.in.read(); } } catch(Exception e) {e.printStackTrace();} } } Then exercise the Tomcat server by launching a telnet session for the Tomcat host and port, such as "telnet localhost 8080", and enter the following: POST /test/cgi-bin/test.sh?a=123&b=xyz HTTP/1.1 Host: localhost:8080 Content-type: text/xml; charset=UTF-8 Content-length: 250 Connection: close <?xml version="1.0" encoding="UTF-8" ?> <Root> <Date>2005-10-27 00:00:00</Date> </Root> The resulting test.out file will contain the submitted XML document prepended with a line containing the query parameters (a=123&b=xyz). Unfortunately the XML parser that is recieving this data is expecting XML data and the query parameters cause an exception (since they are invalid XML). Note also that since the query parameters are included their size is also counted against the provided Content-length value which results in truncating the document when the Content-length is specified as the size of the XML document. -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]