From 9f8718293c503f7599c8a054573114d543f4a44e Mon Sep 17 00:00:00 2001 From: Adin Schmahmann Date: Tue, 25 Jun 2024 16:35:45 -0400 Subject: [PATCH] feat: Rainbow-No-Blockcache is only valid with 'true' --- docs/headers.md | 10 ++++++++++ handlers.go | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/docs/headers.md b/docs/headers.md index 42fe4de..60a0e97 100644 --- a/docs/headers.md +++ b/docs/headers.md @@ -7,3 +7,13 @@ See [`RAINBOW_TRACING_AUTH`](./environment-variables.md#rainbow_tracing_auth) ## `Traceparent` See [`RAINBOW_TRACING_AUTH`](./environment-variables.md#rainbow_tracing_auth) + +## `Tracestate` + +See [`RAINBOW_TRACING_AUTH`](./environment-variables.md#rainbow_tracing_auth) + +## Rainbow-No-Blockcache + +If the value is `true` the associated request will skip the local block cache and leverage a separate in-memory block cache for the request. + +This header is not respected unless the request has a valid `Authorization` header diff --git a/handlers.go b/handlers.go index bb2f420..ae2027e 100644 --- a/handlers.go +++ b/handlers.go @@ -234,7 +234,7 @@ func setupGatewayHandler(cfg Config, nd *Node, tracingAuth string) (http.Handler } // Process cache skipping header - if noBlockCache := request.Header.Get(NoBlockcacheHeader); noBlockCache != "" { + if noBlockCache := request.Header.Get(NoBlockcacheHeader); noBlockCache == "true" { ds, err := leveldb.NewDatastore("", nil) if err != nil { writer.WriteHeader(http.StatusInternalServerError)