kraih/mojo — Issue #266: Use Mojo::UserAgent local request on server-side
Author: Belegkarnil
Created: 2012-01-19 09:43:46+00:00
State: open

Hi !
I try to use the user agent to resolve a file on the server (so, the server send a request to the server himself) and mojolicous freeze.

#!/usr/bin/env perl
use Mojolicious::Lite;
use Mojo::UserAgent;

get '/test' => sub {
my $ua = Mojo::UserAgent->new;
$self->app->log->debug("User agent request\n");
my $res = $ua->get('http://localhost:3000/menu.xml')->res;
$self->app->log->debug("User agent reply\n");
$self->render(	text => $res);
}