mirror of
https://github.com/minio/minio.git
synced 2025-11-08 21:24:55 -05:00
web: GetObjectURL should check if file exists before generating URL.
Fixes - https://github.com/minio/miniobrowser/issues/20
This commit is contained in:
@@ -157,6 +157,13 @@ func (web *WebAPI) GetObjectURL(r *http.Request, args *GetObjectURLArgs, reply *
|
||||
if !isAuthenticated(r) {
|
||||
return errUnAuthorizedRequest
|
||||
}
|
||||
|
||||
// See if object exists.
|
||||
_, e := web.Client.StatObject(args.BucketName, args.ObjectName)
|
||||
if e != nil {
|
||||
return e
|
||||
}
|
||||
|
||||
targetHost, err := getTargetHost(web.apiAddress, args.TargetHost)
|
||||
if err != nil {
|
||||
return probe.WrapError(err)
|
||||
|
||||
Reference in New Issue
Block a user