Comments (4)
I think a patch like this will fix the issue
--- a/swift.go
+++ b/swift.go
@@ -1422,8 +1422,10 @@ func (c *Connection) ObjectOpen(container string, objectName string, checkHash b
file.body = io.TeeReader(resp.Body, file.hash)
}
// Read Content-Length
- file.length, err = getInt64FromHeader(resp, "Content-Length")
- file.lengthOk = (err == nil)
+ if resp.Header.Get("Content-Length") != "" {
+ file.length, err = getInt64FromHeader(resp, "Content-Length")
+ file.lengthOk = (err == nil)
+ }
return
}
Reading through the code, having length not set will mean you can't seek from the end of a file and that is about it.
The Length
method on the file will fetch the length using a HEAD request if required.
I pushed a branch fix-44
with that change in for you to try.
from swift.
I just tested the fix-44 branch and it works perfectly now...
Here is the result with compression turned on in the NetScaler.
downloaded: 100.txt
map[Cteonnt-Length:102400 Last-Modified:Wed, 17 Jun 2015 17:03:48 GMT X-Timestamp:1434560627.86336 Date:Wed, 17 Jun 2015 17:03:48 GMT Accept-Ranges:bytes Cache-Control:private Etag:4c6426ac7ef186464ecbb0d81cbfcb1e X-Trans-Id:tx3025cdfdbf5d4d6092916-005581a874 Content-Type:text/plain; charset=utf-8]
Thank you for the quick turn around on this. Excellent support...
from swift.
Glad it worked and thanks for testing . I'll merge to master shortly...
from swift.
This is merged to master now - thanks for the report
-- Nick
from swift.
Related Issues (20)
- Bulk-delete support in test swift-server HOT 2
- Add application credential auth support
- Support for symlink
- Support status 429 for OVH Cloud Archive HOT 1
- Some questions about StorageUrl and Mutex in Connection struct HOT 4
- Bulk upload method returns err if content type exists charset HOT 2
- Typo ? in DynamicLargeObjectMove HOT 1
- Header is not processed in DynamicLargeObjectCreate HOT 2
- OS_CACERT env variable is not used HOT 3
- Default user domain in password Auth v3 & discarded server error message in Auth HOT 1
- Add inspectable context parameter to API calls HOT 7
- Panic calling DynamicLargeObjectCreateFile with unauthenticated connection HOT 3
- Add support for passing context to API calls HOT 2
- Migrate from travis.org HOT 1
- Time difference between server and client HOT 9
- ObjectCreate() 404 return is wrongly interpreted as ObjectNotFound instead of ContainerNotFound
- slo: no headers for segments HOT 1
- Document about authentication flow may be misleading?
- No support for rate-limit errors with retry-after headers.
- Support for parsing json in ObjectNames()
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from swift.