Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

status code : 411 #3

Closed
denisov opened this issue May 19, 2016 · 4 comments
Closed

status code : 411 #3

denisov opened this issue May 19, 2016 · 4 comments

Comments

@denisov
Copy link
Contributor

denisov commented May 19, 2016

Hi

UploadFile doesn't work for me.
resp, err := flickr.UploadFile(client, "/home/andrey/cat.jpg", nil)

It return the html page with error

<!-- status code : 411 -->
<!-- No Content Length : POST -->
<!-- host machine: r13.ycpi.dea.yahoo.net -->
<!-- timestamp: 1463678271.000 -->
<!-- url: https://up.flickr.com/services/upload/-->

http_client sets Transfer-Encoding: chunked header but doesn't set Content-Lenght header. I guess that's the reason.

I am on Xubuntu 16.04

$ go version
go version go1.6.2 linux/amd64

There is another flickr library https://github.com/mncaudill/go-flickr/ It calculate length manualy https://github.com/mncaudill/go-flickr/blob/master/flickr.go#L164

@masci
Copy link
Owner

masci commented May 22, 2016

Thanks for the feedback @denisov I'll check this out asap

@masci
Copy link
Owner

masci commented May 23, 2016

Still investigating but related to this: golang/go#14391
Works with go < 1.6.2 or v.1.6.2 with GODEBUG=http2client=0 env var set.

@denisov
Copy link
Contributor Author

denisov commented May 24, 2016

Thanks for letting me know

@masci masci closed this as completed in d926a1c Jul 14, 2016
@masci
Copy link
Owner

masci commented Jul 14, 2016

I don't like the fix for this bug but I wasn't able to understand why Flickr fails when we use the h2 client along with a chunked POST request.
Added a comment to remind for a further investigation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants