diff --git a/internal/middleware/headerfilter.go b/internal/middleware/headerfilter.go index 5a17a8a71..de57c2cd8 100644 --- a/internal/middleware/headerfilter.go +++ b/internal/middleware/headerfilter.go @@ -150,11 +150,6 @@ func isHeaderBlocked(state *state.State, c *gin.Context) (bool, error) { } if key != "" { - // if expr != "" { - // // TODO: replace expvar with build - // // taggable metrics types in State{}. - // } - // A header was matched against! // i.e. this request is blocked. return true, nil @@ -185,11 +180,6 @@ func isHeaderAllowed(state *state.State, c *gin.Context) (bool, error) { } if key != "" { - // if expr != "" { - // // TODO: replace expvar with build - // // taggable metrics types in State{}. - // } - // A header was matched against! // i.e. this request is allowed. return true, nil @@ -220,11 +210,6 @@ func isHeaderNotAllowed(state *state.State, c *gin.Context) (bool, error) { } if key != "" { - // if expr != "" { - // // TODO: replace expvar with build - // // taggable metrics types in State{}. - // } - // A header was matched against! // i.e. request is NOT allowed. return true, nil diff --git a/internal/middleware/nollamas.go b/internal/middleware/nollamas.go index 0e99ab3eb..6ae1aee5c 100644 --- a/internal/middleware/nollamas.go +++ b/internal/middleware/nollamas.go @@ -71,12 +71,6 @@ func NoLLaMas(getInstanceV1 func(context.Context) (*apimodel.InstanceV1, gtserro return nollamas.Serve } -// i.e. outputted hash slice length. -const hashLen = sha256.Size - -// i.e. hex.EncodedLen(hashLen). -const encodedHashLen = 2 * hashLen - // hashWithBufs encompasses a hash along // with the necessary buffers to generate // a hashsum and then encode that sum. @@ -111,6 +105,12 @@ func (m *nollamas) Serve(c *gin.Context) { return } + // i.e. outputted hash slice length. + const hashLen = sha256.Size + + // i.e. hex.EncodedLen(hashLen). + const encodedHashLen = 2 * hashLen + // Prepare hash + buffers. hash := hashWithBufs{ hash: sha256.New(),