Skip to content

Commit 91a6968

Browse files
authored
Apply suggestions from code review
Co-authored-by: Marc <m@pyc.ac> Signed-off-by: Marc <m@pyc.ac>
1 parent b8a981d commit 91a6968

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

caddy/caddy_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -652,8 +652,8 @@ func TestWorkerPHPServerGlobals(t *testing.T) {
652652
http.StatusOK,
653653
"SCRIPT_NAME: <br>"+
654654
"SCRIPT_FILENAME: "+scriptFilename+"<br>"+
655-
"PHP_SELF: /en<br>"+
656-
"PATH_INFO: /en<br>"+
655+
"PHP_SELF: <br>"+
656+
"PATH_INFO: <br>"+
657657
"DOCUMENT_ROOT: "+documentRoot2+"<br>"+
658658
"REQUEST_URI: /server-globals.php/en<br>",
659659
)

cgi.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,8 @@ func splitCgiPath(fc *frankenPHPContext) {
215215
fc.scriptFilename = fc.worker.fileName
216216
if strings.HasPrefix(fc.worker.fileName, fc.documentRoot) {
217217
fc.scriptName = filepath.ToSlash(strings.TrimPrefix(fc.worker.fileName, fc.documentRoot))
218+
} else {
219+
fc.pathInfo = ""
218220
}
219221
return
220222
}

0 commit comments

Comments
 (0)