RE: [Http-webtest-general] Temporary redirect and POST don't work together
Brought to you by:
m_ilya,
richardanderson
From: Thieme.Geoff <Geo...@we...> - 2003-11-17 22:48:55
|
Ilya mentioned a new libwww release was out that seems may have changes relevant to my problem. Installing the newest LWP fixed my POST to an SSL cluster problem w/WebTest 2.04. Thanks for the great support Ilya! My CPAN install of LWP installed libwww-perl 5.75 and HTML::Parser 3.34. -----Original Message----- From: Thieme.Geoff Sent: Friday, October 03, 2003 10:36 AM To: 'Ilya Martynov' Cc: htt...@li...; ri...@ri...; Thieme.Geoff Subject: RE: [Http-webtest-general] Temporary redirect and POST don't work together It worked. I did a print $response->title just to make sure it brought back the correct page title, and it did. Here is the output of "use LWP::Debug ('+');" using the reverse proxy: $ time ./WebTestTester.pl LWP::UserAgent::new: () LWP::UserAgent::request: () LWP::UserAgent::send_request: POST https://externalsite/loginvalidation.jsp LWP::UserAgent::_need_proxy: Not proxied LWP::Protocol::http::request: () LWP::UserAgent::request: Simple response: Found LWP::UserAgent::request: () LWP::UserAgent::send_request: POST https://externalsite/loginfailed.jsp LWP::UserAgent::_need_proxy: Not proxied LWP::Protocol::http::request: () LWP::Protocol::collect: read 4096 bytes LWP::Protocol::collect: read 3955 bytes LWP::UserAgent::request: Simple response: OK My Page - Login Failedok real 0m3.820s user 0m0.851s sys 0m0.203s "My Page - Login Failedok" includes the $response->title. BTW, this test is supposed access loginfailed.jsp and say Login Failed. Here is the debug output when accessing an internal web site SSL directly: $ time ./WebTestTester.pl LWP::UserAgent::new: () LWP::UserAgent::request: () LWP::UserAgent::send_request: POST https://internalsite/loginvalidation.jsp LWP::UserAgent::_need_proxy: Not proxied LWP::Protocol::http::request: () LWP::UserAgent::request: Simple response: Found LWP::UserAgent::request: () LWP::UserAgent::send_request: POST https://internalsite/loginfailed.jsp LWP::UserAgent::_need_proxy: Not proxied LWP::Protocol::http::request: () LWP::Protocol::collect: read 4096 bytes LWP::Protocol::collect: read 3955 bytes LWP::UserAgent::request: Simple response: OK My Page - Login Failedok real 0m1.740s user 0m0.851s sys 0m0.143s The only difference I can see from testing with the debug code is that using the reverse proxy takes a lot longer. I looked at the HTTP headers using Lynx to see if there was a difference between using the reverse proxy and not using it. I didn't see any difference from what Lynx was able to show me. Header when accessing loginvalidation.jsp: HTTP/1.1 302 Moved Temporarily Server: Netscape-Enterprise/4.1 Date: Fri, 03 Oct 2003 15:19:29 GMT Set-cookie: jsessionid=378601065194369869;path=/ Location: https://externalsite/loginfailed.jsp Expires: now Content-type: text/html; charset=iso-8859-1 Cache-control: no-cache="set-cookie,set-cookie2" Connection: Close Connection: close Header when finished and stilling on the loginfailed.jsp page: HTTP/1.1 200 OK Server: Netscape-Enterprise/4.1 Date: Fri, 03 Oct 2003 15:28:00 GMT Connection: Keep-alive Expires: now Content-type: text/html; charset=iso-8859-1 Content-length: 8049 Connection: close This leads me to believe there must be differences not seen in the headers. I don't remember if I actually tested a post on an SSL site w/a reverse proxy using HTTP::WebTest 1.xx . I know I tested using a non SSL site. -Geoff -----Original Message----- From: Ilya Martynov [mailto:il...@ip...] Sent: Friday, October 03, 2003 3:13 AM To: Thieme.Geoff Cc: htt...@li...; ri...@ri... Subject: Re: [Http-webtest-general] Temporary redirect and POST don't work together >>>>> "TG" == Thieme Geoff <Geo...@we...> writes: TG> [..snip..] TG> I've run out of ideas to try. If WebTest still allows LWP to TG> handles redirects internally, this may be a problem with TG> LWP. Anyone have any other ideas? I can give you web site address TG> URL and user name if you think it might help. Can you please try following test script: use LWP::UserAgent; my $ua = LWP::UserAgent->new; $ua->requests_redirectable([qw(GET HEAD POST)]); my $response = $ua->post('http://your.site.url', { login => 'xxx', password => 'yyy' }); if ($response->is_success) { print "ok\n" } else { print "Error: " . $self->status_line . "\n"; } If it reproduces the problem (i.e. you get same error message) then it should be either a problem in LWP or in reverse proxy. You can add use LWP::Debug (+); to get all debug log from LWP::Debug. They may be helpful to find what's going on. As I understand HTTP::WebTest 1.xx didn't use $ua->requests_redirectable([qw(GET HEAD POST)]) to let LWP::UserAgent $ua->handle redirects after POST but was doing it itself. Probably it $ua->explains the difference. TG> [..snip..] -- Ilya Martynov, il...@ip... CTO IPonWEB (UK) Ltd Quality Perl Programming and Unix Support UK managed @ offshore prices - http://www.iponweb.net Personal website - http://martynov.org |