Forum Discussion

NSeibert's avatar
NSeibert
Contributor
15 years ago

[Resolved] Redirect is oncorrect

Hello -

Been beating my head against the wall trying to figure this out..

I have a simple http request in soapui that is getting redirected to a https location. When I try this same request in curl, it redirects to the http location.

Not believing my eyes I put the request through wireshark to inspect the redirect url string here. In fact it also claims to recieve a http location for the redirect through the curl and FF.

The soapui http log is here.. Any suggestions on where I might look to figure out why only the soapui request seems to get a https redirect rather than http?

Wed May 18 15:44:30 EDT 2011:DEBUG:>> "GET /dms/device/heartbeat?mac=00%3A00%3A00%3A00%3A00%3A00 HTTP/1.1[\r][\n]"
Wed May 18 15:44:30 EDT 2011:DEBUG:>> "User-Agent: Test Client/virtualX.2[\r][\n]"
Wed May 18 15:44:30 EDT 2011:DEBUG:>> "Host: peepeye[\r][\n]"
Wed May 18 15:44:30 EDT 2011:DEBUG:>> "[\r][\n]"
Wed May 18 15:44:30 EDT 2011:DEBUG:<< "HTTP/1.1 302 Moved Temporarily[\r][\n]"
Wed May 18 15:44:30 EDT 2011:DEBUG:<< "HTTP/1.1 302 Moved Temporarily[\r][\n]"
Wed May 18 15:44:30 EDT 2011:DEBUG:<< "Server: Apache-Coyote/1.1[\r][\n]"
Wed May 18 15:44:30 EDT 2011:DEBUG:<< "Set-Cookie: JSESSIONID=D898BF448AE58220056FA766BEB1E66C; Path=/dms[\r][\n]"
Wed May 18 15:44:30 EDT 2011:DEBUG:<< "Location: https://testserver/dms/device/getCommand?mac=00:00:00:00:00:00[\r][\n]"Wed May 18 15:44:30 EDT 2011:DEBUG:<< "Content-Length: 0[\r][\n]"
Wed May 18 15:44:30 EDT 2011:DEBUG:<< "Date: Wed, 18 May 2011 19:44:30 GMT[\r][\n]"
Wed May 18 15:44:30 EDT 2011:DEBUG:<< "[\r][\n]"


Interestingly when I track the SOAPUI traffic in Wireshark, the redirect is showing as https.

What could make such a difference?

2 Replies

  • Solved! Of all things, the User-Agent header was causing the variance in behavior. Must be a list somewhere of accepted agent strings in Tomcat..

    Had a customized User-Agent in soapui and these request get an https redirect

    GET /device/heartbeat?mac=00%3A00%3A00%3A00%3A00%3A00 HTTP/1.1
    User-Agent: Test Client/virtualX.2
    Host: 10.1.18.41


    GET /device/heartbeat?mac=00%3A00%3A00%3A00%3A00%3A00 HTTP/1.1
    User-Agent: Test Client/v0.2
    Host: 10.1.18.41

    This one gets an http redirect

    GET /device/heartbeat?mac=00:00:00:00:00:00 HTTP/1.1
    User-Agent: curl/7.21.1 (i386-pc-win32) libcurl/7.21.1 OpenSSL/0.9.8o zlib/1.2.5
    Host: 10.1.18.41