mirror of
https://github.com/distribution/distribution.git
synced 2025-09-08 02:09:39 +00:00
Add a read-only mode as a configuration option
Add "readonly" under the storage/maintenance section. When this is set to true, uploads and deletions will return 503 Service Unavailable errors. Document the parameter and add some unit testing. Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
This commit is contained in:
@@ -35,7 +35,7 @@ func blobDispatcher(ctx *Context, r *http.Request) http.Handler {
|
||||
return handlers.MethodHandler{
|
||||
"GET": http.HandlerFunc(blobHandler.GetBlob),
|
||||
"HEAD": http.HandlerFunc(blobHandler.GetBlob),
|
||||
"DELETE": http.HandlerFunc(blobHandler.DeleteBlob),
|
||||
"DELETE": mutableHandler(blobHandler.DeleteBlob, ctx),
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user