63 |
# rewrite URL |
# rewrite URL |
64 |
Frey::CouchAPI->rewrite_urls( $tx ); |
Frey::CouchAPI->rewrite_urls( $tx ); |
65 |
|
|
66 |
if ( $self->static->dispatch($tx) ) { |
if ( ! $self->static->dispatch($tx) ) { |
67 |
# warn "# static ",dump( $tx ); |
# warn "# static ",dump( $tx ); |
68 |
return $tx; |
return $tx; |
69 |
} |
} |
75 |
$body .= join("\n", @_); |
$body .= join("\n", @_); |
76 |
}; |
}; |
77 |
|
|
78 |
my $url = $tx->req->url->to_string; |
my $url = $tx->req->url->to_abs->to_string; |
79 |
my $params = $tx->req->params->to_hash; |
my $params = $tx->req->params->to_hash; |
80 |
|
|
81 |
my $referer = $tx->req->content->headers->header('Referer'); |
my $referer = $tx->req->content->headers->header('Referer'); |
82 |
my $ajax = $tx->req->content->headers->header('X-Requested-With'); |
my $ajax = $tx->req->content->headers->header('X-Requested-With'); |
83 |
warn "# referer $referer\n"; |
warn "# referer $referer\n"; |
84 |
warn "# headers = ", dump( $tx->req->content->headers ); |
# warn "## headers = ", dump( $tx->req->content->headers ); |
85 |
|
|
86 |
if ( $referer =~ m{/_utils} || $ajax =~ m{XMLHttpRequest}i ) { |
if ( $referer =~ m{/_utils} || $ajax =~ m{XMLHttpRequest}i ) { |
87 |
return Frey::CouchAPI->dispatch( $tx ); |
return Frey::CouchAPI->dispatch( $tx ); |