Mantis - Resin
Viewing Issue Advanced Details
322 minor always 07-19-05 00:00 11-30-05 14:43
user317  
 
normal  
closed 3.0.14  
3.0.14 fixed  
none    
none 3.0.15  
0000322: FastCGIServlet does not handle Status header properly
RSN-366
The FastCGIServlet included with Resin does not properly handle the Status header of the fcgi response. It will fail if the status header included the description along with the status code.

"Status: 200" => works fine
"Status: 200 OK" => will fail

The problem is that the entire text after "Status: " is passed to Integer.parseInt. In order for wider fastcgi compatibility, it should handle these cases properly.


[19:22:20.620] java.lang.NumberFormatException: For input string: "200 OK"
[19:22:20.620] at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
[19:22:20.620] at java.lang.Integer.parseInt(Integer.java:477)
[19:22:20.620] at java.lang.Integer.parseInt(Integer.java:518)
[19:22:20.620] at com.caucho.servlets.FastCGIServlet.parseHeaders(FastCGIServlet.java:383)
[19:22:20.620] at com.caucho.servlets.FastCGIServlet.handleRequest(FastCGIServlet.java:211)
[19:22:20.620] at com.caucho.servlets.FastCGIServlet.service(FastCGIServlet.java:154)
[19:22:20.620] at com.caucho.server.dispatch.ServletFilterChain.doFilter(ServletFilterChain.java:99)
[19:22:20.620] at com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.java:163)
[19:22:20.620] at com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:208)
[19:22:20.620] at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:259)
[19:22:20.620] at com.caucho.server.port.TcpConnection.run(TcpConnection.java:363)
[19:22:20.620] at com.caucho.util.ThreadPool.runTasks(ThreadPool.java:490)
[19:22:20.620] at com.caucho.util.ThreadPool.run(ThreadPool.java:423)
[19:22:20.620] at java.lang.Thread.run(Thread.java:552)
Mac OS X 10.4.2, Resin 3.0.14

There are no notes attached to this issue.