/[Frey]/trunk/lib/Frey/Mojo.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/lib/Frey/Mojo.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1168 by dpavlin, Thu Jul 2 21:55:44 2009 UTC revision 1169 by dpavlin, Thu Jul 2 22:22:20 2009 UTC
# Line 86  sub handler { Line 86  sub handler {
86          }          }
87    
88          # FIXME this should move somewhere          # FIXME this should move somewhere
89          my $path = $tx->req->url->path;          my $url = $tx->req->url->to_abs->to_string;
90          if ( $path =~ m{/($rewrite_regex)} ) {          if ( $url =~ m{/($rewrite_regex)} ) {
91                  my $from = $1;                  my $from = $1;
92                  my $to = $mapping_url->{$from} || return tx_die( $tx, 500, "Unknown $from" );                  my $to = $mapping_url->{$from} || return tx_die( $tx, 500, "Unknown $from" );
93                  $tx->req->url->path( $to );  
94                    $url =~ s{/($from)}{/$to};
95    
96                    $tx->req->url( Mojo::URL->new($url) );
97                  warn "ACL $from -> $to OK\n";                  warn "ACL $from -> $to OK\n";
98          } else {          } else {
99                  return tx_die( $tx, 404, "Noting at $path") if ! $ENV{FREY_DEV};                  return tx_die( $tx, 404, "Noting at $url") if ! $ENV{FREY_DEV};
100          }          }
101    
102          my $body;          my $body;
# Line 103  sub handler { Line 106  sub handler {
106                  $body .= join("\n", @_);                  $body .= join("\n", @_);
107          };          };
108    
         my $url = $tx->req->url->to_abs->to_string;  
109          my $params = $tx->req->params->to_hash;          my $params = $tx->req->params->to_hash;
110    
111          my $referer = $tx->req->content->headers->header('Referer');          my $referer = $tx->req->content->headers->header('Referer');

Legend:
Removed from v.1168  
changed lines
  Added in v.1169

  ViewVC Help
Powered by ViewVC 1.1.26