Fixes tests, moves layerhandler in config file

This commit is contained in:
Brian Bland 2015-01-08 17:29:22 -08:00
parent abb901e4ab
commit cc3c648f44
3 changed files with 16 additions and 10 deletions

View file

@ -58,10 +58,12 @@ func (lh *layerHandler) GetLayer(w http.ResponseWriter, r *http.Request) {
}
defer layer.Close()
handler, err := lh.layerHandler.Resolve(layer)
if handler != nil {
handler.ServeHTTP(w, r)
return
if lh.layerHandler != nil {
handler, _ := lh.layerHandler.Resolve(layer)
if handler != nil {
handler.ServeHTTP(w, r)
return
}
}
http.ServeContent(w, r, layer.Digest().String(), layer.CreatedAt(), layer)