aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorroot <root@rbsd.ankarstrom.se>2021-04-24 14:50:05 +0000
committerroot <root@rbsd.ankarstrom.se>2021-04-24 14:50:05 +0000
commit9de1f3d2445f84180da4243522ede7955012eeaf (patch)
tree70eebfa2a5fd675b7f5a6cd4942c5379b8b16e68
parent713e751bb92b6cf957de17ed6cd7ff3c0a3c9f2c (diff)
downloadApache-Inject-9de1f3d2445f84180da4243522ede7955012eeaf.tar.gz
Re-arrange source code
-rw-r--r--lib/Apache/Inject/Handler.pm44
-rwxr-xr-xt/SMOKE2
2 files changed, 23 insertions, 23 deletions
diff --git a/lib/Apache/Inject/Handler.pm b/lib/Apache/Inject/Handler.pm
index 6c1a282..794eb2f 100644
--- a/lib/Apache/Inject/Handler.pm
+++ b/lib/Apache/Inject/Handler.pm
@@ -28,6 +28,28 @@ my $doc = qr{
\z
}xmsi;
+sub handler {
+ my $r = shift;
+
+ return DECLINED if not $r->content_type eq 'text/html';
+
+ my $content = ${$r->slurp_filename};
+ return DECLINED if not $content =~ /$doc/;
+
+ if (not $r->document_root) {
+ $r->warn('Inject: Declining request due to empty document root');
+ return DECLINED;
+ }
+
+ print $+{head} if $+{head};
+ inject($r, "InjectHead");
+ print $+{body} if $+{body};
+ inject($r, "InjectFoot");
+ print $+{rest} if $+{rest};
+
+ return OK;
+}
+
sub inject {
my ($r, $var) = @_;
@@ -56,26 +78,4 @@ sub inject {
close $fh;
}
-sub handler {
- my $r = shift;
-
- return DECLINED if not $r->content_type eq 'text/html';
-
- my $content = ${$r->slurp_filename};
- return DECLINED if not $content =~ /$doc/;
-
- if (not $r->document_root) {
- $r->warn('Inject: Declining request due to empty document root');
- return DECLINED;
- }
-
- print $+{head} if $+{head};
- inject($r, "InjectHead");
- print $+{body} if $+{body};
- inject($r, "InjectFoot");
- print $+{rest} if $+{rest};
-
- return OK;
-}
-
1;
diff --git a/t/SMOKE b/t/SMOKE
index 5bb18f1..5710dda 100755
--- a/t/SMOKE
+++ b/t/SMOKE
@@ -1,6 +1,6 @@
#!/usr/local/bin/perl
# WARNING: this file is generated, do not edit
-# generated on Sat Apr 24 01:01:16 2021
+# generated on Sat Apr 24 14:48:36 2021
# 01: /usr/local/lib/perl5/site_perl/mach/5.32/Apache/TestConfig.pm:1003
# 02: /usr/local/lib/perl5/site_perl/mach/5.32/Apache/TestConfig.pm:1095
# 03: /usr/local/lib/perl5/site_perl/mach/5.32/Apache/TestSmoke.pm:775