Update ReadFrom to wrap reader in NopCloser
Wrapping the reader in a NopCloser is necessary to prevent the http library from closing the input reader. Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)master
							parent
							
								
									49f7f54d07
								
							
						
					
					
						commit
						68d5ecf6bf
					
				|  | @ -5,6 +5,7 @@ import ( | |||
| 	"errors" | ||||
| 	"fmt" | ||||
| 	"io" | ||||
| 	"io/ioutil" | ||||
| 	"net/http" | ||||
| 	"os" | ||||
| 	"time" | ||||
|  | @ -33,7 +34,7 @@ func (hlu *httpLayerUpload) handleErrorResponse(resp *http.Response) error { | |||
| } | ||||
| 
 | ||||
| func (hlu *httpLayerUpload) ReadFrom(r io.Reader) (n int64, err error) { | ||||
| 	req, err := http.NewRequest("PATCH", hlu.location, r) | ||||
| 	req, err := http.NewRequest("PATCH", hlu.location, ioutil.NopCloser(r)) | ||||
| 	if err != nil { | ||||
| 		return 0, err | ||||
| 	} | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue