mirror: fix 0 byte files not getting mirrored (#2739)

Fixes: #2737
This commit is contained in:
poornas
2019-04-03 08:15:17 -07:00
committed by kannappanr
parent b27cd5ada8
commit 8ae04b41b0
+3 -1
View File
@@ -353,7 +353,9 @@ func (mj *mirrorJob) watchMirror(ctx context.Context, cancelMirror context.Cance
}
sourceURL := newClientURL(eventPath)
aliasedPath := strings.Replace(eventPath, sourceURLFull, mj.sourceURL, -1)
// trim trailing slash from source url
sourceURLStr := strings.TrimSuffix(sourceURLFull, string(sourceURL.Separator))
aliasedPath := strings.Replace(eventPath, sourceURLStr, mj.sourceURL, -1)
// build target path, it is the relative of the eventPath with the sourceUrl
// joined to the targetURL.