@@ -32,6 +32,7 @@ var testServerSettings = ServerSettings{
3232 UseInfinityServer : false ,
3333 InfinityServerURL : "https://infinity.unstable.life/Flashpoint/Legacy/htdocs/" ,
3434 LegacyHTDOCSPath : "" ,
35+ LegacyCGIBINPath : "" ,
3536 ExtScriptTypes : []string {
3637 "php" ,
3738 },
@@ -50,6 +51,17 @@ func setup(settings *ServerSettings) {
5051 }
5152 testServerSettings .LegacyHTDOCSPath = path .Join (cwd , "testdata" , "htdocs" )
5253 settings .LegacyHTDOCSPath = testServerSettings .LegacyHTDOCSPath
54+ testServerSettings .LegacyCGIBINPath = path .Join (cwd , "testdata" , "cgi-bin" )
55+ settings .LegacyCGIBINPath = testServerSettings .LegacyCGIBINPath
56+ // Create directories if missing
57+ err = os .MkdirAll (testServerSettings .LegacyHTDOCSPath , os .ModePerm )
58+ if err != nil {
59+ panic (err )
60+ }
61+ err = os .MkdirAll (testServerSettings .LegacyCGIBINPath , os .ModePerm )
62+ if err != nil {
63+ panic (err )
64+ }
5365 }
5466 // Cleanup and remake htdocs
5567 err := os .RemoveAll (testServerSettings .LegacyHTDOCSPath )
@@ -255,7 +267,7 @@ func TestServeLegacy200Script(t *testing.T) {
255267 // Write a test file
256268 testStr := "success"
257269 testData := []byte (fmt .Sprintf ("<?php echo \" %s\" ; ?>" , testStr ))
258- testFile := path .Join (testServerSettings .LegacyHTDOCSPath , "example.com" , "index.php" )
270+ testFile := path .Join (testServerSettings .LegacyCGIBINPath , "example.com" , "index.php" )
259271 // Make directory path
260272 err := os .MkdirAll (path .Dir (testFile ), os .ModePerm )
261273 if err != nil {
0 commit comments