code: func CreatePutUploadHandler(storage blobserver.BlobReceiver) http.Handler {
  	return http.HandlerFunc(func(rw http.ResponseWriter, req *http.Request) {
  		ctx := req.Context()
  		if req.Method != "PUT" {
  			log.Printf("Inconfigured upload handler.")
  			httputil.BadRequestError(rw, "Inconfigured handler.")
  			return
  		}
  		// For non-chunked uploads, we catch it here. For chunked uploads, it's caught
  		// by blobserver.Receive's LimitReader.
  		if req.ContentLength > blobserver.MaxBlobSize {
  			httputil.BadRequestError(rw, "blob too big")
  			return
  		}
  		blobrefStr := path.Base(req.URL.Path)
  		br, ok := blob.Parse(blobrefStr)
  		if !ok {
  			log.Printf("Invalid PUT request to %q", req.URL.Path)
  			httputil.BadRequestError(rw, "Bad path")
  			return
  		}
  		if !br.IsSupported() {
  			httputil.BadRequestError(rw, "unsupported object hash function")
  			return
  		}
  		_, err := blobserver.Receive(ctx, storage, br, req.Body)
  		if err == blobserver.ErrCorruptBlob {
  			httputil.BadRequestError(rw, "data doesn't match declared digest")
  			return
  		}
  		if err != nil {
  			httputil.ServeError(rw, req, err)
  			return
  		}
  		rw.WriteHeader(http.StatusNoContent)
  	})
  }
docs: // CreatePutUploadHandler returns the handler that receives a single
  // blob at the blob's final URL, via the PUT method.  See
  // doc/protocol/blob-upload-protocol.txt.