Skip to content

Commit

Permalink
redirect
Browse files Browse the repository at this point in the history
Signed-off-by: Liang Zheng <zhengliang0901@gmail.com>
  • Loading branch information
microyahoo committed Jan 10, 2024
1 parent effa655 commit c377191
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion registry/storage/blobserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func (bs *blobServer) ServeBlob(ctx context.Context, w http.ResponseWriter, r *h
return err
}

if bs.redirect {
if bs.redirect { // redirect url
redirectURL, err := bs.driver.RedirectURL(r, path)
if err != nil {
return err
Expand Down
2 changes: 1 addition & 1 deletion registry/storage/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ type RegistryOption func(*registry) error

// EnableRedirect is a functional option for NewRegistry. It causes the backend
// blob server to attempt using (StorageDriver).RedirectURL to serve all blobs.
func EnableRedirect(registry *registry) error {
func EnableRedirect(registry *registry) error { // 是否 enable redirect
registry.blobServer.redirect = true
return nil
}
Expand Down

0 comments on commit c377191

Please sign in to comment.