#!/usr/sbin/lighttpd-suid /usr/bin/perl -w
use strict;
use v5.10;
$_ = <>;
chomp;
if (/\./ || /\// || /\%/) {
print "Location: /hax\n\n";
exit;
}
@_ = <>;
say "Content-type: text/plain\n";
open my $fh, ">", "../lua/incoming/$_" or do {
say "Can't open $_ for writing.";
exit;
};
print $fh @_;
close($fh);
say "Wrote $_.";