[Dancer-users] redirect path is wrong
WK
wanradt at gmail.com
Tue Jun 5 00:04:55 CEST 2012
2012/6/5 Mr. Puneet Kishor <punk.kish at gmail.com>:
> In my code, I have put the following
>
> get '/resource.:format' { return redirect '/gmna/resource.:format'; };
> get '/gmna/resource.:format' => {
> ..
> };
>
> But the above fails. One, the redirect doesn't seem to recognize and carry the .:format through (if I call resource.json, the program complains that '/gmna/resource.:format' wasn't found).
AFAIU, redirect needs path or url, it does not work with tokens, you
need to give param or variable, like:
get '/resource.:format' { return redirect '/gmna/resource.' .
param('format'); };
> Second, it doesn't prefix the /app/d/geomaps part to the redirected URI.
Some threads back it was asked also. Return can't originate from your
prefix, because then is not possible to redirect to non-prefixed
paths. Solution is to write your own wrapper like
redirect_with_prefix.
--
Wbr,
Kõike hääd,
Gunnar
More information about the Dancer-users
mailing list