diff options
| author | fukachan <fukachan> | 2002-08-28 14:07:20 +0000 |
|---|---|---|
| committer | fukachan <fukachan> | 2002-08-28 14:07:20 +0000 |
| commit | b210b0f351bb151efd5cdbefd6ff8603b24eff3c (patch) | |
| tree | bbecbef5a1dd9fd80b3493bac456d210849725e5 /regress/simulation | |
| parent | 68327bafae7847cb9fb36ff25b1d5972c3237ac1 (diff) | |
| download | fml8-b210b0f351bb151efd5cdbefd6ff8603b24eff3c.tar.gz fml8-b210b0f351bb151efd5cdbefd6ff8603b24eff3c.tar.bz2 fml8-b210b0f351bb151efd5cdbefd6ff8603b24eff3c.zip | |
add a hook to reject non text/plain message.
Diffstat (limited to 'regress/simulation')
| -rw-r--r-- | regress/simulation/config.cf | 22 |
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"); + } }; |
