Skip to content

Commit d14dbb9

Browse files
committed
fix(serverHandler/responseData): ensure request path exists
1 parent b8530b6 commit d14dbb9

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/serverHandler/responseData.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,9 @@ func (h *handler) stateIndexFile(rawReqPath, baseDir string, baseItem os.FileInf
262262

263263
func (h *handler) getResponseData(r *http.Request) *responseData {
264264
requestUri := r.URL.Path
265+
if len(requestUri) == 0 {
266+
requestUri = "/"
267+
}
265268
tailSlash := requestUri[len(requestUri)-1] == '/'
266269

267270
rawReqPath := util.CleanUrlPath(requestUri)

0 commit comments

Comments
 (0)