diff --git a/sapi/fpm/tests/fcgi-env-pif-apache-pp-sn-strip-basic.phpt b/sapi/fpm/tests/fcgi-env-pif-apache-pp-sn-strip-basic.phpt new file mode 100644 index 00000000000..c0c0fc93608 --- /dev/null +++ b/sapi/fpm/tests/fcgi-env-pif-apache-pp-sn-strip-basic.phpt @@ -0,0 +1,54 @@ +--TEST-- +FPM: FastCGI env var path info fix for Apache ProxyPass SCRIPT_NAME stripping with basic path +--SKIPIF-- + +--FILE-- +createSourceFileAndScriptName(); +$tester->start(); +$tester->expectLogStartNotices(); +$tester + ->request( + uri: $scriptName . '/pinfo', + scriptFilename: "proxy:fcgi://" . $tester->getAddr() . $sourceFilePath . '/pinfo', + scriptName: $scriptName . '/pinfo' + ) + ->expectBody([$scriptName, $scriptName . '/pinfo', $sourceFilePath, '/pinfo', $scriptName . '/pinfo']); +$tester->terminate(); +$tester->close(); + +?> +Done +--EXPECT-- +Done +--CLEAN-- + diff --git a/sapi/fpm/tests/fcgi-env-pif-apache-pp-sn-strip-invalid.phpt b/sapi/fpm/tests/fcgi-env-pif-apache-pp-sn-strip-invalid.phpt new file mode 100644 index 00000000000..ebc86bf931e --- /dev/null +++ b/sapi/fpm/tests/fcgi-env-pif-apache-pp-sn-strip-invalid.phpt @@ -0,0 +1,54 @@ +--TEST-- +FPM: FastCGI env var path info fix for Apache ProxyPass SCRIPT_NAME stripping with invalid path +--SKIPIF-- + +--FILE-- +createSourceFileAndScriptName(); +$tester->start(); +$tester->expectLogStartNotices(); +$tester + ->request( + uri: $scriptName . '/pinfox', + scriptFilename: "proxy:fcgi://" . $tester->getAddr() . $sourceFilePath . '/pinfoy', + scriptName: $scriptName . '/pinfox' // this would be a bug in Apache - just for testing + ) + ->expectBody([$scriptName . '/pinfox', 'none', $sourceFilePath, '/pinfoy', $scriptName . '/pinfox/pinfoy']); +$tester->terminate(); +$tester->close(); + +?> +Done +--EXPECT-- +Done +--CLEAN-- +