Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Not A Bug
-
Affects Version/s: JRuby 1.1.6
-
Fix Version/s: None
-
Component/s: JRuby-extras
-
Labels:None
-
Number of attachments :
Description
To reproduce the problem, get this code: http://github.com/intalio/csv2xml/tree/02d4593992bd2f201ed297ef08597dd8bd59c6c1
warble it and attach the war to Tomcat.
Then try to do:
wget http://localhost:8080/csv2xml/ --post-data=http://spreadsheets.google.com/pub?key=pUUnwYG6cM0fYXYlDiPY9Tw&output=csv
The body of a POST request in the servlet is not populated.
Quick investigation. ServletRackEnvironment exposes the body part through getInput().
DefaultRackApplication uses getInput() to create a RubyIO object. Then it creates a to_io method that is supposed to return the input.
The servlet.rb file uses to_io and binds it to a key named rack.input (line 114).
The Request class in Rack makes use of that key like this:
def body; @env["rack.input"] end
In the end it might well be me who is missing something. From a code standpoint, it makes sense.