Skip to content

Commit

Permalink
fix code generation in oauth2 controller
Browse files Browse the repository at this point in the history
tr takes a character class. Trying to give it a class wrapped in
brackets will try to convert the bracket characters. We're just
generating a random ID, so it's ok for the format being generated to
change.
  • Loading branch information
haarg committed Jul 14, 2024
1 parent e99a859 commit 71d98fc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/MetaCPAN/Server/Controller/OAuth2.pm
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ sub bad_request {

sub _build_code {
my $digest = Digest::SHA::sha1_base64( rand() . $$ . {} . time );
$digest =~ tr/[+\/]/-_/;
$digest =~ tr{+/}{-_};

Check warning on line 112 in lib/MetaCPAN/Server/Controller/OAuth2.pm

View check run for this annotation

Codecov / codecov/patch

lib/MetaCPAN/Server/Controller/OAuth2.pm#L112

Added line #L112 was not covered by tests
return $digest;
}

Expand Down

0 comments on commit 71d98fc

Please sign in to comment.