Return back normal object names not URL's
This commit is contained in:
@@ -78,13 +78,14 @@ func runGoBuild(ctx *cli.Context) {
|
||||
if mcBuildErr != nil {
|
||||
console.Fatalln(mcBuildErr)
|
||||
}
|
||||
var mcTestOut bytes.Buffer
|
||||
mcTest.Stdout = &mcTestOut
|
||||
var mcTestStdOut bytes.Buffer
|
||||
mcTest.Stdout = &mcTestStdOut
|
||||
mcTestErr := mcTest.Run()
|
||||
if mcTestErr != nil {
|
||||
fmt.Print(mcTestStdOut.String())
|
||||
console.Fatalln(mcTestErr)
|
||||
}
|
||||
fmt.Print(mcTestOut.String())
|
||||
fmt.Print(mcTestStdOut.String())
|
||||
mcInstallErr := mcInstall.Run()
|
||||
if mcInstallErr != nil {
|
||||
console.Fatalln(mcInstallErr)
|
||||
|
||||
+3
-4
@@ -174,7 +174,7 @@ func (c *s3Client) Stat() (*client.Content, error) {
|
||||
}
|
||||
return nil, iodine.New(err, nil)
|
||||
}
|
||||
objectMetadata.Name = c.hostURL.String() // do not change this
|
||||
objectMetadata.Name = metadata.Key
|
||||
objectMetadata.Time = metadata.LastModified
|
||||
objectMetadata.Size = metadata.Size
|
||||
objectMetadata.Type = os.FileMode(0664)
|
||||
@@ -313,7 +313,7 @@ func (c *s3Client) listRecursiveInRoutine(contentCh chan client.ContentOnChannel
|
||||
return
|
||||
}
|
||||
content := new(client.Content)
|
||||
content.Name = strings.TrimSuffix(c.hostURL.String(), "/") + "/" + object.Stat.Key
|
||||
content.Name = object.Stat.Key
|
||||
content.Size = object.Stat.Size
|
||||
content.Time = object.Stat.LastModified
|
||||
content.Type = os.FileMode(0664)
|
||||
@@ -334,8 +334,7 @@ func (c *s3Client) listRecursiveInRoutine(contentCh chan client.ContentOnChannel
|
||||
}
|
||||
content := new(client.Content)
|
||||
normalizedKey := strings.TrimPrefix(object.Stat.Key, strings.TrimSuffix(o, "/")+"/")
|
||||
hostPrefix := strings.TrimSuffix(c.hostURL.String(), "/") + "/"
|
||||
content.Name = hostPrefix + normalizedKey
|
||||
content.Name = normalizedKey
|
||||
content.Size = object.Stat.Size
|
||||
content.Time = object.Stat.LastModified
|
||||
content.Type = os.FileMode(0664)
|
||||
|
||||
@@ -180,7 +180,7 @@ func (s *MySuite) TestObjectOperations(c *C) {
|
||||
|
||||
content, err := s3c.Stat()
|
||||
c.Assert(err, IsNil)
|
||||
c.Assert(content.Name, Equals, server.URL+object.resource)
|
||||
c.Assert(content.Name, Equals, "object")
|
||||
c.Assert(content.Size, Equals, int64(len(object.data)))
|
||||
c.Assert(content.Type.IsRegular(), Equals, true)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user