return_url => request->path [Dancer::Plugin::Auth::Extensible]
Users of DPAE, ---- %<---- $ grep request Extensible.pm return redirect uri_for($loginpage, { return_url => request->path }); return redirect uri_for($loginpage, { return_url => request->path }); return redirect uri_for($deniedpage, { return_url => request->path }); This is developed on GitHub - please feel free to raise issues or pull requests ---- >%---- I am building an app with Dancer::Plugin::Auth::Extensible Apache deployment like this: AddHandler fastcgi-script .fcgi RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ /dispatch.fcgi/$1 [QSA,L] I do not want the SCRIPT_NAME but I do want the query_string "?foo=bar" in the return_url. Changing "request->path" into "request->request_uri" does it for me. Is this the "right" patch? -- Henk
On Mon, 3 Jun 2013 23:00:15 +0200 (CEST) Henk van Oers <hvo.pm@xs4all.nl> wrote:
Users of DPAE,
---- %<---- $ grep request Extensible.pm return redirect uri_for($loginpage, { return_url => request->path }); [...]
I do not want the SCRIPT_NAME but I do want the query_string "?foo=bar" in the return_url.
Changing "request->path" into "request->request_uri" does it for me.
Is this the "right" patch?
That sounds sane to me - request->request_uri is far more likely to be what the user will want than request->path. Good spot :) Feel free to submit a PR for that change if you have a moment? -- David Precious ("bigpresh") <davidp@preshweb.co.uk> http://www.preshweb.co.uk/ www.preshweb.co.uk/twitter www.preshweb.co.uk/linkedin www.preshweb.co.uk/facebook www.preshweb.co.uk/cpan www.preshweb.co.uk/github
I think there is already my issue about it in github. I'm using this solution: hook 'before' => sub { # when running under Apache/mod_fastcgi request->{env}->{SCRIPT_NAME} = ''; ... }; 04.06.2013 3:00, Henk van Oers пишет:
I am building an app with Dancer::Plugin::Auth::Extensible Apache deployment like this: AddHandler fastcgi-script .fcgi RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ /dispatch.fcgi/$1 [QSA,L]
I do not want the SCRIPT_NAME but I do want the query_string "?foo=bar" in the return_url.
Changing "request->path" into "request->request_uri" does it for me.
Is this the "right" patch?
-- Best Regards, Nick Knutov http://knutov.com ICQ: 272873706 Voice: +7-904-84-23-130
On Tue, 4 Jun 2013, Nick Knutov wrote:
I think there is already my issue about it in github. I'm using this solution:
hook 'before' => sub { # when running under Apache/mod_fastcgi request->{env}->{SCRIPT_NAME} = ''; ... };
What about the query_string in your case? Can you test that?
04.06.2013 3:00, Henk van Oers пишет:
I am building an app with Dancer::Plugin::Auth::Extensible Apache deployment like this: AddHandler fastcgi-script .fcgi RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ /dispatch.fcgi/$1 [QSA,L]
I do not want the SCRIPT_NAME but I do want the query_string "?foo=bar" in the return_url.
Changing "request->path" into "request->request_uri" does it for me.
Is this the "right" patch?
oeps, used wrong sender... On Tue, 4 Jun 2013, Henk van Oers wrote:
On Tue, 4 Jun 2013, Nick Knutov wrote:
I think there is already my issue about it in github. I'm using this solution:
hook 'before' => sub { # when running under Apache/mod_fastcgi request->{env}->{SCRIPT_NAME} = ''; ... };
What about the query_string in your case?
Can you test that?
04.06.2013 3:00, Henk van Oers пишет:
I am building an app with Dancer::Plugin::Auth::Extensible Apache deployment like this: AddHandler fastcgi-script .fcgi RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ /dispatch.fcgi/$1 [QSA,L]
I do not want the SCRIPT_NAME but I do want the query_string "?foo=bar" in the return_url.
Changing "request->path" into "request->request_uri" does it for me.
Is this the "right" patch?
Everything is fine, for example I have urls like /user/123/action/?save=1 and they work. Looks like my dispatch.fcgi also changed: ================================ #!/usr/bin/env perl use Dancer ':syntax'; use FindBin '$RealBin'; use Plack::Handler::FCGI; set apphandler => 'PSGI'; set environment => 'production'; $ENV{SCRIPT_NAME} = ''; my $psgi = path($RealBin, '..', 'bin', 'app.pl'); my $app = do($psgi); die "Unable to read startup script: $@" if $@; my $server = Plack::Handler::FCGI->new(nproc => 1, detach => 1); $server->run($app); ================================ .htaccess: ================================ Options +ExecCGI DirectoryIndex /dispatch.fcgi RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !\.(swf)|(jpg)|(png)|(gif)$ RewriteRule ^(.+)$ /dispatch.fcgi/$1 [L,QSA] ================================ 04.06.2013 5:20, Henk van Oers пишет:
oeps, used wrong sender...
On Tue, 4 Jun 2013, Henk van Oers wrote:
On Tue, 4 Jun 2013, Nick Knutov wrote:
I think there is already my issue about it in github. I'm using this solution:
hook 'before' => sub { # when running under Apache/mod_fastcgi request->{env}->{SCRIPT_NAME} = ''; ... };
What about the query_string in your case?
Can you test that?
-- Best Regards, Nick Knutov http://knutov.com ICQ: 272873706 Voice: +7-904-84-23-130
On Tue, 4 Jun 2013, Nick Knutov wrote:
I think there is already my issue about it in github. I'm using this solution:
hook 'before' => sub { # when running under Apache/mod_fastcgi request->{env}->{SCRIPT_NAME} = ''; ... };
I forgot to thank you for this. I'm using this too now.
Changing "request->path" into "request->request_uri" does it for me.
(But the SCRIPT_NAME wasn't completely gone.) -- Henk
Try to add $ENV{SCRIPT_NAME} = ''; to dispatch.fcgi (it was in my next mail). 08.06.2013 16:48, Henk van Oers пишет:
On Tue, 4 Jun 2013, Nick Knutov wrote:
I think there is already my issue about it in github. I'm using this solution:
hook 'before' => sub { # when running under Apache/mod_fastcgi request->{env}->{SCRIPT_NAME} = ''; ... };
I forgot to thank you for this. I'm using this too now.
Changing "request->path" into "request->request_uri" does it for me.
(But the SCRIPT_NAME wasn't completely gone.)
-- Best Regards, Nick Knutov http://knutov.com ICQ: 272873706 Voice: +7-904-84-23-130
On Sat, 8 Jun 2013, Nick Knutov wrote:
Try to add
$ENV{SCRIPT_NAME} = '';
to dispatch.fcgi (it was in my next mail).
I did that too, thank you. Btw: Shouldn't be the default for non-plain-CGI to delete the SCRIPT_NAME? -- Henk
08.06.2013 16:48, Henk van Oers пишет:
On Tue, 4 Jun 2013, Nick Knutov wrote:
I think there is already my issue about it in github. I'm using this solution:
hook 'before' => sub { # when running under Apache/mod_fastcgi request->{env}->{SCRIPT_NAME} = ''; ... };
I forgot to thank you for this. I'm using this too now.
Changing "request->path" into "request->request_uri" does it for me.
(But the SCRIPT_NAME wasn't completely gone.)
It depends. It can be so for beautiful human readable urls IF you have mod_rewrite. It should be as it is now if you don't have mod_rewrite. Good point to make this default is you are always have mod_rewrite in real world with any used in practice software. 08.06.2013 17:34, Henk van Oers пишет:
On Sat, 8 Jun 2013, Nick Knutov wrote:
Try to add
$ENV{SCRIPT_NAME} = '';
to dispatch.fcgi (it was in my next mail).
I did that too, thank you.
Btw: Shouldn't be the default for non-plain-CGI to delete the SCRIPT_NAME?
-- Henk
08.06.2013 16:48, Henk van Oers пишет:
On Tue, 4 Jun 2013, Nick Knutov wrote:
I think there is already my issue about it in github. I'm using this solution:
hook 'before' => sub { # when running under Apache/mod_fastcgi request->{env}->{SCRIPT_NAME} = ''; ... };
I forgot to thank you for this. I'm using this too now.
Changing "request->path" into "request->request_uri" does it for me.
(But the SCRIPT_NAME wasn't completely gone.)
_______________________________________________ dancer-users mailing list dancer-users@dancer.pm http://lists.preshweb.co.uk/mailman/listinfo/dancer-users
-- Best Regards, Nick Knutov http://knutov.com ICQ: 272873706 Voice: +7-904-84-23-130
participants (4)
-
David Precious -
Henk van Oers -
Henk van Oers -
Nick Knutov