added debug for path

This commit is contained in:
2023-03-20 23:08:03 +00:00
parent 0b865da234
commit fd684ba652
2 changed files with 2 additions and 1 deletions

View File

@@ -111,12 +111,13 @@ func webGatewayHandler(backend *core.Backend) func(w http.ResponseWriter, r *htt
// Assume it is in the format "/[blockchain public key]/[file hash]".
// Remove slash prefix and suffix.
fmt.Println(r.URL.Path)
pathA := strings.TrimPrefix(strings.TrimSuffix(r.URL.Path, "/"), "/")
pathParts := strings.Split(pathA, "/")
if len(pathParts) != 1 && len(pathParts) != 2 {
http.Error(w, "404 not found", http.StatusNotFound)
//return
return
}
// Default timeout for connection is 10 seconds. This will be an optional parameter in the future.