javaswift / joss

Java library for OpenStack Storage, aka Swift
http://javaswift.org
117 stars 108 forks source link

text/html gzip etag exception #150

Open CoolLifeLaugh opened 6 years ago

CoolLifeLaugh commented 6 years ago

when nginx transfer , text/html type , etag is deleted. but image null point exception

mjmbischoff commented 6 years ago

Pull request fixes it for getting the objects as inputstream, since getting the expected etag doesn't throw any exceptions. It will fail with a nullpointer if a MD5 can be calculated on the client, but the server doesn't report any (because it's stripped out by some proxy/loadbalancer/intermediate).

It's really annoying that the openstack swift designers decided to reuse the HTTP etag field which has slightly different semantics.

I'm not entirely sure what behavior we want if we can actually compose an md5. Given we don't have an etag and we can calculate an MD5: should it fail or silently ignore the check?

@ferrys do you have a particular opinion on this?