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; |
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'); |