Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add Args(0) to controller actions not expected to recieve args #1275

Merged
merged 1 commit into from
Sep 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/MetaCPAN/Server/Controller.pm
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ sub model {
return $model;
}

sub mapping : Path('_mapping') {
sub mapping : Path('_mapping') Args(0) {
my ( $self, $c ) = @_;
$c->stash(
$c->model('CPAN')->es->indices->get_mapping(
Expand Down
2 changes: 1 addition & 1 deletion lib/MetaCPAN/Server/Controller/Login.pm
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ sub auto : Private {
return 1;
}

sub index : Path {
sub index : Path Args(0) {
my ( $self, $c ) = @_;
my @login = map { "<li><a href=\"/login/" . lc($_) . "\">$_</a></li>" }
sort map /^Login::(.*)/, $c->controllers;
Expand Down
2 changes: 1 addition & 1 deletion lib/MetaCPAN/Server/Controller/Login/GitHub.pm
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ has [qw(consumer_key consumer_secret)] => (
required => 1,
);

sub index : Path {
sub index : Path Args(0) {
my ( $self, $c ) = @_;
if ( my $code = $c->req->params->{code} ) {
my $ua = LWP::UserAgent->new;
Expand Down
2 changes: 1 addition & 1 deletion lib/MetaCPAN/Server/Controller/Login/Google.pm
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ has [qw( consumer_key consumer_secret )] => (
required => 1,
);

sub index : Path {
sub index : Path Args(0) {
my ( $self, $c ) = @_;
my $req = $c->req;

Expand Down
2 changes: 1 addition & 1 deletion lib/MetaCPAN/Server/Controller/Login/PAUSE.pm
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ sub _build_cache {
);
}

sub index : Path {
sub index : Path Args(0) {
my ( $self, $c ) = @_;
my $code = $c->req->params->{code};
my $id;
Expand Down
2 changes: 1 addition & 1 deletion lib/MetaCPAN/Server/Controller/Login/Twitter.pm
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ sub nt {
);
}

sub index : Path {
sub index : Path Args(0) {
my ( $self, $c ) = @_;
my $req = $c->req;

Expand Down
2 changes: 1 addition & 1 deletion lib/MetaCPAN/Server/Controller/Pod.pm
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ sub find_dist_links {
return $links;
}

sub render : Path('/pod_render') {
sub render : Path('/pod_render') Args(0) {
my ( $self, $c ) = @_;
my $pod = $c->req->parameters->{pod};
my $show_errors = !!$c->req->parameters->{show_errors};
Expand Down
2 changes: 1 addition & 1 deletion lib/MetaCPAN/Server/Controller/Root.pm
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ sub bad_request : Private {
$c->forward( $c->view('JSON') );
}

sub robots : Path("robots.txt") {
sub robots : Path("robots.txt") Args(0) {
my ( $self, $c ) = @_;
$c->res->content_type("text/plain");
$c->res->body("User-agent: *\nDisallow: /\n");
Expand Down
2 changes: 1 addition & 1 deletion lib/MetaCPAN/Server/Controller/User.pm
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ sub auto : Private {
return $c->user_exists;
}

sub index : Path {
sub index : Path Args(0) {
my ( $self, $c ) = @_;
$c->stash( $c->user->data );
delete $c->stash->{code};
Expand Down