Mailinglist Archive: opensuse-buildservice (233 mails)

< Previous Next >
Re: [opensuse-buildservice] BSRPC: support redirects
  • From: Michal Marek <mmarek@xxxxxxx>
  • Date: Sat, 13 Dec 2008 23:31:11 +0100
  • Message-id: <494437AF.8030006@xxxxxxx>
Marcus Hüwe napsal(a):
Index: BSRPC.pm
===================================================================
--- BSRPC.pm (Revision 5877)
+++ BSRPC.pm (Arbeitskopie)
@@ -225,14 +225,20 @@
}
my %headers;
BSHTTP::gethead(\%headers, $headers);
- if ($status !~ /^200[^\d]/) {
+ if ($status =~ /^200[^\d]/) {
+ undef $status;
+ } elsif ($status =~ /^302[^\d]/) {
+ # XXX: should we do the redirect if $param->{'ignorestatus'} is defined?
+ close S;
+ die("status 302 but no 'location' header found\n") unless exists
$headers{'location'};
+ $param->{'uri'} = $headers{'location'};
+ return rpc($param, $xmlargs, @args);

Shouldn't there be an upper limit on the number of redirects?

Michal
--
To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse-buildservice+help@xxxxxxxxxxxx

< Previous Next >
Follow Ups
References