summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--regress/simulation/config.cf22
1 files changed, 13 insertions, 9 deletions
diff --git a/regress/simulation/config.cf b/regress/simulation/config.cf
index 1203f892..7d7d8a85 100644
--- a/regress/simulation/config.cf
+++ b/regress/simulation/config.cf
@@ -32,16 +32,20 @@ sql_server = mysql.home.fml.org
=cut
#
-# write HOOKS after here if needed.
+# write HOOKS (perl scripts) after here if needed.
#
$distribute_run_start_hook = q{
-
- print STDERR "hook: hey!\n";
-
- my $header = $curproc->{ incoming_message }->{ header };
-
- print STDERR $header->get('content-type');
-
- sleep 2;
+ use FML::Log qw(Log LogError);
+
+ my $header = $curproc->incoming_message_header();
+ my $ct = $header->get('content-type');
+
+ if ($ct =~ m@^\s*text/plain@i) {
+ Log("hook: text/plain ok");
+ }
+ else {
+ $curproc->stop_this_process();
+ LogError("hook: not text/plain");
+ }
};