From d62808d1d146ddf49df1344584562ac0ebf13949 Mon Sep 17 00:00:00 2001 From: Henrique Dias Date: Thu, 25 May 2023 10:56:59 +0200 Subject: [PATCH] rv Co-authored-by: Marcin Rataj --- gateway/handler_car.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/gateway/handler_car.go b/gateway/handler_car.go index 4e405cb7e..a0b34c8f5 100644 --- a/gateway/handler_car.go +++ b/gateway/handler_car.go @@ -17,8 +17,10 @@ import ( "go.uber.org/multierr" ) -const carRangeBytesKey = "entity-bytes" -const carTerminalElementTypeKey = "dag-scope" +const ( + carRangeBytesKey = "entity-bytes" + carTerminalElementTypeKey = "dag-scope" +) // serveCAR returns a CAR stream for specific DAG+selector func (i *handler) serveCAR(ctx context.Context, w http.ResponseWriter, r *http.Request, imPath ImmutablePath, contentPath ipath.Path, carVersion string, begin time.Time) bool { @@ -56,7 +58,7 @@ func (i *handler) serveCAR(ctx context.Context, w http.ResponseWriter, r *http.R case dagScopeEntity, dagScopeAll, dagScopeBlock: params.Scope = s default: - err := fmt.Errorf("unsupported dag-scope %s", scopeStr) + err := fmt.Errorf("unsupported dag-scope %q", scopeStr) webError(w, err, http.StatusBadRequest) return false }