Skip to content

Commit a8f3b21

Browse files
authored
Merge pull request #1275 from metacpan/haarg/no-args
add Args(0) to controller actions not expected to recieve args
2 parents 8bbdd3e + 18dcf6b commit a8f3b21

File tree

9 files changed

+9
-9
lines changed

9 files changed

+9
-9
lines changed

lib/MetaCPAN/Server/Controller.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ sub model {
5252
return $model;
5353
}
5454

55-
sub mapping : Path('_mapping') {
55+
sub mapping : Path('_mapping') Args(0) {
5656
my ( $self, $c ) = @_;
5757
$c->stash(
5858
$c->model('CPAN')->es->indices->get_mapping(

lib/MetaCPAN/Server/Controller/Login.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ sub auto : Private {
2626
return 1;
2727
}
2828

29-
sub index : Path {
29+
sub index : Path Args(0) {
3030
my ( $self, $c ) = @_;
3131
my @login = map { "<li><a href=\"/login/" . lc($_) . "\">$_</a></li>" }
3232
sort map /^Login::(.*)/, $c->controllers;

lib/MetaCPAN/Server/Controller/Login/GitHub.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ has [qw(consumer_key consumer_secret)] => (
1313
required => 1,
1414
);
1515

16-
sub index : Path {
16+
sub index : Path Args(0) {
1717
my ( $self, $c ) = @_;
1818
if ( my $code = $c->req->params->{code} ) {
1919
my $ua = LWP::UserAgent->new;

lib/MetaCPAN/Server/Controller/Login/Google.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ has [qw( consumer_key consumer_secret )] => (
1515
required => 1,
1616
);
1717

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

lib/MetaCPAN/Server/Controller/Login/PAUSE.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ sub _build_cache {
2323
);
2424
}
2525

26-
sub index : Path {
26+
sub index : Path Args(0) {
2727
my ( $self, $c ) = @_;
2828
my $code = $c->req->params->{code};
2929
my $id;

lib/MetaCPAN/Server/Controller/Login/Twitter.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ sub nt {
2020
);
2121
}
2222

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

lib/MetaCPAN/Server/Controller/Pod.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ sub find_dist_links {
7777
return $links;
7878
}
7979

80-
sub render : Path('/pod_render') {
80+
sub render : Path('/pod_render') Args(0) {
8181
my ( $self, $c ) = @_;
8282
my $pod = $c->req->parameters->{pod};
8383
my $show_errors = !!$c->req->parameters->{show_errors};

lib/MetaCPAN/Server/Controller/Root.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ sub bad_request : Private {
6262
$c->forward( $c->view('JSON') );
6363
}
6464

65-
sub robots : Path("robots.txt") {
65+
sub robots : Path("robots.txt") Args(0) {
6666
my ( $self, $c ) = @_;
6767
$c->res->content_type("text/plain");
6868
$c->res->body("User-agent: *\nDisallow: /\n");

lib/MetaCPAN/Server/Controller/User.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ sub auto : Private {
3131
return $c->user_exists;
3232
}
3333

34-
sub index : Path {
34+
sub index : Path Args(0) {
3535
my ( $self, $c ) = @_;
3636
$c->stash( $c->user->data );
3737
delete $c->stash->{code};

0 commit comments

Comments
 (0)