From: Tomas Doran (t0m) Date: Mon, 13 Jul 2009 16:30:30 +0000 (+0100) Subject: Actually try to use the code in anger, fix issues X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=9bdb832c5b825d09f362f45b244e2230be66b8a6;hp=339e4a1a7552f6dfd4d24c9ed1c2d261f408989c;p=catagits%2FCatalyst-TraitFor-Request-ProxyBase.git Actually try to use the code in anger, fix issues --- diff --git a/Changes b/Changes index f611bad..570d1ff 100644 --- a/Changes +++ b/Changes @@ -1,3 +1,6 @@ +0.000002 + + - Always apply the Request base to $c->req->base, not just on assignment. 0.000001 diff --git a/lib/Catalyst/TraitFor/Request/ProxyBase.pm b/lib/Catalyst/TraitFor/Request/ProxyBase.pm index cc9961d..80faefb 100644 --- a/lib/Catalyst/TraitFor/Request/ProxyBase.pm +++ b/lib/Catalyst/TraitFor/Request/ProxyBase.pm @@ -3,7 +3,7 @@ use Moose::Role; use URI (); use namespace::autoclean; -our $VERSION = '0.000001'; +our $VERSION = '0.000002'; requires qw/ base @@ -12,11 +12,9 @@ requires qw/ around 'base' => sub { my ($orig, $self, @args) = @_; - if (scalar @args) { - if (my $base = $self->header('X-Request-Base')) { - $base .= '/' unless $base =~ m|/$|; - @args = (URI->new($base)); - } + if (my $base = $self->header('X-Request-Base')) { + $base .= '/' unless $base =~ m|/$|; + @args = (URI->new($base)); } $self->$orig(@args); };