[Catalyst] uri_for method is returning relative URLs

Robert Rothenberg robrwo at gmail.com
Wed Jan 18 09:58:09 GMT 2012


On 17/01/12 18:09 Alexander Hartmaier wrote:
> uri_for falls back to interpreting the passed string as plain string,
> like a path to a static resource, not an action.
> To make sure it returns an url for an action use uri_for_action instead
> which will die if it can't the action.

It also does the same thing for static resources, like stylesheets and
JavaScript files.

More details: it turns out that this occurs when using the app_fastcgi.pl
server (through nginx).

When running app_server.pl and changing nginx to make use of
Catalyst::Engine::HTTP::Prefork, this problem doesn't occur.

So is there something about FastCGI that is doing this?


> 
> Am 2012-01-17 18:43, schrieb Robert Rothenberg:
>> I have a Catalyst app that I have been working on with another developer.
>>
>> In this application, the links in the templates use the uri_for method, e.g.
>>
>>    <a href="[% c.uri_for('/login') %]">Login</a>
>>
>> This works fine on two machines that we have been developing on.
>>
>> I've recently installed it on a third machine with Perl 5.12.3 and Catalyst
>> 5.90007.  On that machine, the method seems to be returning relative URLs,
>> e.g. on the page "/login", c.uri_for("/logout") returns a link to
>> "/login/logout" instead of "/logout".
>>
>> Has anybody seen this issue before?
>>
>>
>>
>>
>>
>> _______________________________________________
>> List: Catalyst at lists.scsys.co.uk
>> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
>> Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
>> Dev site: http://dev.catalyst.perl.org/
> 
> 
> *"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
> T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien
> Handelsgericht Wien, FN 79340b
> *"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
> Notice: This e-mail contains information that is confidential and may be
> privileged.
> If you are not the intended recipient, please notify the sender and then
> delete this e-mail immediately.
> *"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
> 
> _______________________________________________
> List: Catalyst at lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
> Dev site: http://dev.catalyst.perl.org/




More information about the Catalyst mailing list