ncw / swift

Go language interface to Swift / Openstack Object Storage / Rackspace cloud files (golang)
MIT License
310 stars 107 forks source link

Update documentation and tests on updating Content-Type #150

Open thiagodasilva opened 4 years ago

thiagodasilva commented 4 years ago

Newer swift no longer requires a copy in place to update content-type.

Updated a bit of the docs and added test to demonstrate the differences in behavior when using ObjectUpdateContentType and ObjectUpdate to update Content-Type

Signed-off-by: Thiago da Silva thiagodasilva@gmail.com

ncw commented 4 years ago

This code looks nice too! However we have problems running the tests on older swift versions - any ideas?

thiagodasilva commented 4 years ago

I think in this case, there's an issue with the swift emulator, here: https://github.com/ncw/swift/blob/master/swifttest/server.go#L198,L209

It's always adding new custom metadata to an object, when in fact, whenever you post to an object, the previous custom headers are lost. This has always been the swift behavior. I'm adding a new test to clearly show the functionality.

ncw commented 4 years ago

Looks like we are going to need a fix to the emulator to get this to pass the tests! Are you working on that?

thiagodasilva commented 4 years ago

@ncw I haven't looked at fixing the emulator yet. Having said that, would you consider running the travis ci tests against a docker saio image? I think it would make more sense that maintaining a swift emulator, thoughts?

ncw commented 4 years ago

@ncw I haven't looked at fixing the emulator yet. Having said that, would you consider running the travis ci tests against a docker saio image? I think it would make more sense that maintaining a swift emulator, thoughts?

I think I'd like to do both - fix the emulator and run against the swift aio!