1
0
mirror of https://github.com/rclone/rclone.git synced 2025-12-06 00:03:32 +00:00

rcd: prefix patch for rcd and web-gui

This commit is contained in:
Chaitanya
2019-08-21 00:17:57 +05:30
committed by Nick Craig-Wood
parent efd826ad4b
commit 159f2e29a8
2 changed files with 8 additions and 4 deletions

View File

@@ -138,7 +138,11 @@ func writeError(path string, in rc.Params, w http.ResponseWriter, err error, sta
// handler reads incoming requests and dispatches them
func (s *Server) handler(w http.ResponseWriter, r *http.Request) {
path := strings.TrimLeft(r.URL.Path, "/")
urlPath, ok := s.Path(w, r)
if !ok {
return
}
path := strings.TrimLeft(urlPath, "/")
allowOrigin := rcflags.Opt.AccessControlAllowOrigin
if allowOrigin != "" {
@@ -311,6 +315,7 @@ func (s *Server) handleGet(w http.ResponseWriter, r *http.Request, path string)
return
case s.files != nil:
// Serve the files
r.URL.Path = "/" + path
s.files.ServeHTTP(w, r)
return
case path == "" && s.opt.Serve: