From 0b7379c51c75548aca151c205c4bf537f73a93f8 Mon Sep 17 00:00:00 2001 From: "E. Choroba" Date: Sun, 4 Nov 2018 23:35:56 +0100 Subject: [PATCH 1/2] Put load_module directives before the stream block Fixes #69. --- lib/Test/Nginx/Util.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Test/Nginx/Util.pm b/lib/Test/Nginx/Util.pm index 085083a0..2f40bd9e 100644 --- a/lib/Test/Nginx/Util.pm +++ b/lib/Test/Nginx/Util.pm @@ -906,7 +906,7 @@ sub write_config_file ($$) { if ($LoadModules) { my @modules = map { "load_module $_;" } grep { $_ } split /\s+/, $LoadModules; if (@modules) { - $main_config .= join " ", @modules; + substr $main_config, 0, 0, join " ", @modules; } } From 2064823b52c93424ba31d0a597cece229682a36a Mon Sep 17 00:00:00 2001 From: "E. Choroba" Date: Mon, 5 Nov 2018 01:40:37 +0100 Subject: [PATCH 2/2] fixup! Put load_module directives before the stream block --- lib/Test/Nginx/Util.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Test/Nginx/Util.pm b/lib/Test/Nginx/Util.pm index 2f40bd9e..29705b26 100644 --- a/lib/Test/Nginx/Util.pm +++ b/lib/Test/Nginx/Util.pm @@ -906,7 +906,7 @@ sub write_config_file ($$) { if ($LoadModules) { my @modules = map { "load_module $_;" } grep { $_ } split /\s+/, $LoadModules; if (@modules) { - substr $main_config, 0, 0, join " ", @modules; + $main_config = join " ", @modules, $main_config; } }