Skip to content

Commit

Permalink
string replace hijack
Browse files Browse the repository at this point in the history
  • Loading branch information
eumel8 committed Nov 15, 2023
1 parent 4fbe893 commit d0d8ecb
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pkg/agent/http_hijack.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"net/http"
"net/url"
"strconv"
"strings"
"time"

"github.com/caas-team/prometheus-auth/pkg/data"
Expand Down Expand Up @@ -52,11 +53,11 @@ func hijackFederate(apiCtx *apiContext) error {

log.Debugf("raw federate[%s - %d] => %s", apiCtx.tag, idx, rawValue)
hjkValue := modifyExpression(expr, apiCtx.namespaceSet)
orJob := " or caasglobal=\"entsoe\""
orJob := " or caasglobal=\"entsoe\"}"
log.Debugf("hjk federate[%s - %d] => %s %s", apiCtx.tag, idx, hjkValue, orJob)

hjkValue = strings.Replace(hjkValue, "}", orJob, -1)
queries.Add("match[]", hjkValue)
queries.Add("match[]", orJob)
}

// inject
Expand Down

0 comments on commit d0d8ecb

Please sign in to comment.