don't parse image, for invalid server responses.#56
don't parse image, for invalid server responses.#56palamccc wants to merge 1 commit intowillnorris:masterfrom
Conversation
|
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed, please reply here (e.g.
|
|
I signed it! |
|
CLAs look good, thanks! |
|
So I'm curious what the motivation for this is. Were you running into specific trouble? It's entirely possible that the remote server returns an image with a non-200 response. In which case, transforming the image as requested still sort of makes sense. If the response isn't an image, then it obviously won't be transformed anyway. |
| if err != nil { | ||
| glog.Errorf("error transforming image: %v", err) | ||
| var img []byte; | ||
| if resp.StatusCode == 200 { |
There was a problem hiding this comment.
if resp.StatusCode == http.StatusOK {
...
}
Related to Issue/PR willnorris#56
|
Closing this PR, since there was never any response to why this is actually needed. (Please feel free to continue the discussion if this is still needed) @huguesalary's betabrand@34252f7 seemed to be related to this (though I'm not 100% sure how). That has now been merged as 3444fd9, so maybe that fixes the root issue anyway? |
No description provided.