abujehad139 / google-api-go-client

Automatically exported from code.google.com/p/google-api-go-client
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Resumable upload always starts at the beginning #72

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Start a resumable upload (e.g. YouTube video)
2. Grab the URL
3. Try continuing the upload process later

What is the expected output? What do you see instead?
The expected behavior would be that the upload starts at the last valid offset, 
but because of a parsing error the offset is always 0.

Please provide any additional information below.
The problem is that the RegEx[2] that parses the Range header starts with the ^ 
operator but a server would respond with "bytes=0/0"[1]. There is a test 
case[3] wich accepts/expects a malformed Range response.

Note that I use a slightly modified client which allows me to intercept and 
store the upload URL before continung to upload. While this feature is probably 
not useful for most people, it might be a nice addion (mostly for me because I 
wouldn't have to maintain an extra API layer :). 

And yes, I know, you only accept patches via Gerrit but reading the 
contribution guide seems to be a bit of a hassle for a one character fix (well, 
3 lines if you count the test case).

[1] http://tools.ietf.org/html/rfc2616#page-138
[2] 
https://github.com/google/google-api-go-client/blob/master/googleapi/googleapi.g
o#L299
[3] 
https://github.com/google/google-api-go-client/blob/master/googleapi/googleapi_t
est.go#L426-L428

Original issue reported on code.google.com by coss...@googlemail.com on 23 Feb 2015 at 5:00

Attachments: