Insert request method option storage driver URLFor
Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)
This commit is contained in:
parent
efb24490c7
commit
fdd6314776
1 changed files with 1 additions and 1 deletions
|
@ -38,7 +38,7 @@ func (lr *layerReader) Close() error {
|
||||||
func (lr *layerReader) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
func (lr *layerReader) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||||
w.Header().Set("Docker-Content-Digest", lr.digest.String())
|
w.Header().Set("Docker-Content-Digest", lr.digest.String())
|
||||||
|
|
||||||
if url, err := lr.fileReader.driver.URLFor(lr.path, map[string]interface{}{}); err == nil {
|
if url, err := lr.fileReader.driver.URLFor(lr.path, map[string]interface{}{"method": r.Method}); err == nil {
|
||||||
http.Redirect(w, r, url, http.StatusTemporaryRedirect)
|
http.Redirect(w, r, url, http.StatusTemporaryRedirect)
|
||||||
}
|
}
|
||||||
http.ServeContent(w, r, lr.digest.String(), lr.CreatedAt(), lr)
|
http.ServeContent(w, r, lr.digest.String(), lr.CreatedAt(), lr)
|
||||||
|
|
Loading…
Reference in a new issue