[svn:parrot] r46767 - trunk/runtime/parrot/library
fperrad at svn.parrot.org
fperrad at svn.parrot.org
Tue May 18 16:15:53 UTC 2010
Author: fperrad
Date: Tue May 18 16:15:52 2010
New Revision: 46767
URL: https://trac.parrot.org/parrot/changeset/46767
Log:
[LWP] fix redirection when relative path
Modified:
trunk/runtime/parrot/library/LWP.pir
Modified: trunk/runtime/parrot/library/LWP.pir
==============================================================================
--- trunk/runtime/parrot/library/LWP.pir Tue May 18 16:03:27 2010 (r46766)
+++ trunk/runtime/parrot/library/LWP.pir Tue May 18 16:15:52 2010 (r46767)
@@ -158,14 +158,26 @@
referral_uri = response.'get_header'('Location')
$P0 = get_hll_global ['URI'], 'new_from_string'
$P1 = $P0(referral_uri)
+ $S0 = $P1.'scheme'()
+ unless $S0 == '' goto L5
+ $P2 = new 'StringBuilder'
+ $P3 = request.'uri'()
+ $S0 = $P3.'scheme'()
+ push $P2, $S0
+ push $P2, '://'
+ $S0 = request.'get_header'('Host')
+ push $P2, $S0
+ push $P2, referral_uri
+ $P1 = $P0($P2)
+ L5:
setattribute referral, 'uri', $P1
# work in progress
$I0 = self.'redirect_ok'(referral, response)
- if $I0 goto L5
+ if $I0 goto L6
.return (response)
- L5:
+ L6:
.tailcall self.'request'(referral, response)
L4:
More information about the parrot-commits
mailing list