Skip to content

Commit

Permalink
Fix Buildable webhook endopoint
Browse files Browse the repository at this point in the history
GitHub is making POST requests, not just GET. Note that in this case
we're just interested in the push event itself, not about the data, so
there are no secrets or anything else, and it's fine. The endpoint is
public and everyone is free to trigger the builds if they want
to (though why would they do that?).
  • Loading branch information
AlexDaniel committed Oct 7, 2023
1 parent f748c50 commit 367b3c6
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions xbin/Buildable.p6
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,8 @@ ensure-config;
use Cro::HTTP::Router;
use Cro::HTTP::Server;
my $application = route {
get -> {
$trigger-supplier.emit(True);
content 'text/html', 'OK'
}
get -> { $trigger-supplier.emit(True); content 'text/html', 'OK' }
post -> { $trigger-supplier.emit(True); content 'text/html', 'OK' }
}
my Cro::Service $service = Cro::HTTP::Server.new:
:host($CONFIG<buildable><host>), :port($CONFIG<buildable><port>), :$application;
Expand Down

0 comments on commit 367b3c6

Please sign in to comment.