We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2a32861 commit 652322bCopy full SHA for 652322b
1 file changed
cgi.go
@@ -218,13 +218,9 @@ func splitCgiPath(fc *frankenPHPContext) {
218
}
219
220
// Strip PATH_INFO from SCRIPT_NAME
221
- fc.scriptName = strings.TrimSuffix(path, fc.pathInfo)
222
-
223
// Ensure the SCRIPT_NAME has a leading slash for compliance with RFC3875
224
// Info: https://tools.ietf.org/html/rfc3875#section-4.1.13
225
- if fc.scriptName != "" && !strings.HasPrefix(fc.scriptName, "/") {
226
- fc.scriptName = "/" + fc.scriptName
227
- }
+ fc.scriptName = ensureLeadingSlash(strings.TrimSuffix(path, fc.pathInfo))
228
229
// TODO: is it possible to delay this and avoid saving everything in the context?
230
// SCRIPT_FILENAME is the absolute path of SCRIPT_NAME
0 commit comments