Forum Discussion

eirirlar's avatar
13 years ago

Invalid Content-Length on redirect

SoapUI 4.0.0 seems to handle redirects incorrectly.

I've spent ages debugging the following sequence: HTTP POST, answered by a 302, followed by a HTTP GET. The sequence works nicely in Firefox, but in SoapUI it fails in the last request. The problem seems to be the Content-Length of the last GET-request in the sequence; SoapUI sets it to the same as the initial HTTP POST, wheras Firefox (correctly, I presume) skips it. Below is the log output of a tcptunnel I set up between the client and the server. Please note the difference in Content-Length of the last GET-requests.

On Jetty, this extra Content-Length field causes the server to hang and the SoapUI test keeps waiting for the response forever. On Tomcat, it causes the server to consume parts of the next request(!) which causes the server to fail in various ways.

Right now it seems the only workaround is to disable Follow-Redirects in the initial POST, and construct the next GET manually. However it would be really nice if the fix for this would make it into your next bugfix release.

From Firefox:
-------------

>>>>>>
POST /car-web/login.jsf HTTP/1.1
Host: localhost:8085
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 115
Connection: keep-alive
Referer: http://localhost:8085/car-web/login.jsf ... 3k8w5a187t
Cookie: JSESSIONID=1vgb7un5vjxurt83k8w5a187t
Content-Type: application/x-www-form-urlencoded
Content-Length: 174

j_idt7=j_idt7&j_idt7%3Aj_username=&j_idt7%3Aj_password=&j_idt7%3Abrukere%3A1%3Aj_idt15=Logg+deg+inn+som+denne&javax.faces.ViewState=-3297167591325999316%3A4707333904768787433

<<<<<<
HTTP/1.1 302 Found
Date: Mon, 11 Jul 2011 12:50:06 GMT
X-Powered-By: JSF/2.0
Location: http://localhost:8085/car-web/carer.jsf
Content-Length: 0
Server: Jetty(7.2.1.v20101111)

>>>>>>
GET /car-web/carer.jsf HTTP/1.1
Host: localhost:8085
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 115
Connection: keep-alive
Referer: http://localhost:8085/car-web/login.jsf ... 3k8w5a187t
Cookie: JSESSIONID=1vgb7un5vjxurt83k8w5a187t

<<<<<<
HTTP/1.1 200 OK
Date: Mon, 11 Jul 2011 12:50:06 GMT
X-Powered-By: JSF/2.0
Content-Type: text/html;charset=UTF-8
Content-Length: 7225
Server: Jetty(7.2.1.v20101111)

[content]


From SoapUI
-----------

>>>>>>
POST /car-web/login.jsf HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: application/x-www-form-urlencoded
Accept-Language: en-us,en;q=0.5
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Referer: http://localhost:8085/car-web/login.jsf
Keep-Alive: 115
Connection: keep-alive
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
User-Agent: Jakarta Commons-HttpClient/3.1
Host: localhost:8085
Cookie: $Version=0; JSESSIONID=1v08s5g2inf9711wqb1u7tgnop; $Path=/car-web
Content-Length: 171

j_idt7=j_idt7&j_idt7%3Aj_username=&j_idt7%3Aj_password=&j_idt7%3Abrukere%3A1%3Aj_idt15=Logg+deg+inn+som+denne&javax.faces.ViewState=8100439204510673828:-945399672408008326

<<<<<<
HTTP/1.1 302 Found
Date: Mon, 11 Jul 2011 13:02:23 GMT
X-Powered-By: JSF/2.0
Location: http://localhost:8085/car-web/carer.jsf
Content-Length: 0
Server: Jetty(7.2.1.v20101111)

>>>>>>
GET /car-web/carer.jsf HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: application/x-www-form-urlencoded
Accept-Language: en-us,en;q=0.5
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Referer: http://localhost:8085/car-web/login.jsf
Keep-Alive: 115
Connection: keep-alive
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
User-Agent: Jakarta Commons-HttpClient/3.1
Content-Length: 171
Host: localhost:8085
Cookie: $Version=0; JSESSIONID=1v08s5g2inf9711wqb1u7tgnop; $Path=/car-web

[No more data from server]
No RepliesBe the first to reply