Show
Ignore:
Timestamp:
04/25/08 20:55:44 (5 years ago)
Author:
tokuhirom
Message:

うわー。仕様勘違いしまくってた。あとでちゃんとテストかく。これじゃ Apache->uri でしかつかえないよ。

Location:
lang/perl/HTTPx-Dispatcher/trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • lang/perl/HTTPx-Dispatcher/trunk/lib/HTTPx/Dispatcher/Rule.pm

    r10433 r10454  
    3939    my ($self, $req) = @_; 
    4040    croak "request required" unless blessed $req; 
    41     my $uri = $req->uri; 
     41 
     42    my $uri = ref($req->uri) ? $req->uri->path : $req->uri; 
    4243    $uri =~ s!^/+!!; 
    43     $uri =~ s!\?.+!!; 
    4444 
    4545    return unless $self->_condition_check( $req ); 
  • lang/perl/HTTPx-Dispatcher/trunk/t/01_simple.t

    r10421 r10454  
    2626 
    2727    my $method = $input->{method} || 'GET'; 
    28     my $res = $pkg->match(HTTP::Request->new($method, $input->{uri})); 
     28    my $res = $pkg->match(HTTP::Request->new($method, "http://example.com/$input->{uri}")); 
    2929    $res = ((not defined $res) ? 'undef' : YAML::Dump($res)); 
    3030    $res =~ s/^---\n//; 
     
    3232} 
    3333 
    34  
    3534__END__ 
    3635 
    3736=== 
    3837--- input 
    39 src: '' 
     38src: connect '', { controller => 'Root', action => 'index' } 
    4039uri: / 
    41 --- expected: undef 
     40--- expected 
     41action: index 
     42args: {} 
     43controller: Root 
    4244 
    4345===