diff --git a/server-main.go b/server-main.go index 207856e21..eb7da3598 100644 --- a/server-main.go +++ b/server-main.go @@ -292,7 +292,7 @@ func serverMain(c *cli.Context) { minFreeDisk = 10 args := c.Args() - for len(args) >= 1 { + for len(args) >= 2 { switch args.First() { case "min-free-disk": if minFreeDiskSet { diff --git a/web-handlers.go b/web-handlers.go index 0bb4eb02d..819dbab8d 100644 --- a/web-handlers.go +++ b/web-handlers.go @@ -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)