From 5c118d901d5e0a81c20996be4330e4c14b202405 Mon Sep 17 00:00:00 2001 From: swag Date: Fri, 22 Jul 2022 00:56:57 -0400 Subject: [PATCH] Only send the Webhook in prod --- README.md | 3 ++- guestbook-ng.pl | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 78b22fa..61147f2 100644 --- a/README.md +++ b/README.md @@ -54,4 +54,5 @@ Add the `-v` option for more verbose output ## TODOs -1. Have FUN +1. Do something about the hardcoded URL in Webhook stuff +1. Document Webhook stuff diff --git a/guestbook-ng.pl b/guestbook-ng.pl index b6faefb..95eb937 100755 --- a/guestbook-ng.pl +++ b/guestbook-ng.pl @@ -92,7 +92,7 @@ any [qw{GET POST}], '/sign' => sub ($c) { $c->flash(error => 'This message was flagged as spam') } # Send this notification if there's a Webhook URL - elsif (-s '.tom.url') { + elsif (app->mode() eq 'production' && -s '.tom.url') { my ($url_file, $url, $webhook); open($url_file, '.tom.url') || die "$@";