Skip to content

Commit

Permalink
makes const private
Browse files Browse the repository at this point in the history
  • Loading branch information
M4tteoP committed Nov 23, 2023
1 parent 45a0377 commit 0640eed
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions internal/bodyprocessors/urlencoded.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
type urlencodedBodyProcessor struct {
}

const URLUnescape = true
const urlUnescape = true

func (*urlencodedBodyProcessor) ProcessRequest(reader io.Reader, v plugintypes.TransactionVariables, options plugintypes.BodyProcessorOptions) error {
buf := new(strings.Builder)
Expand All @@ -25,7 +25,7 @@ func (*urlencodedBodyProcessor) ProcessRequest(reader io.Reader, v plugintypes.T
}

b := buf.String()
values := urlutil.ParseQuery(b, '&', URLUnescape)
values := urlutil.ParseQuery(b, '&', urlUnescape)
argsCol := v.ArgsPost()
for k, vs := range values {
argsCol.Set(k, vs)
Expand Down
10 changes: 5 additions & 5 deletions internal/corazawaf/transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ type Transaction struct {
}

const (
URLUnescape = true
noURLUnescape = false
urlUnescape = true
noUrlUnescape = false
)

func (tx *Transaction) ID() string {
Expand Down Expand Up @@ -326,8 +326,8 @@ func (tx *Transaction) AddRequestHeader(key string, value string) {
}
case "cookie":
// Cookies use the same syntax as GET params but with semicolon (;) separator
// noURLUnescape is used to avoid implicitly performing an URL decode on the cookies
values := urlutil.ParseQuery(value, ';', noURLUnescape)
// noUrlUnescape is used to avoid implicitly performing an URL decode on the cookies
values := urlutil.ParseQuery(value, ';', noUrlUnescape)
for k, vr := range values {
for _, v := range vr {
tx.variables.requestCookies.Add(k, v)
Expand Down Expand Up @@ -639,7 +639,7 @@ func (tx *Transaction) ProcessConnection(client string, cPort int, server string

// ExtractGetArguments transforms an url encoded string to a map and creates ARGS_GET
func (tx *Transaction) ExtractGetArguments(uri string) {
data := urlutil.ParseQuery(uri, '&', URLUnescape)
data := urlutil.ParseQuery(uri, '&', urlUnescape)
for k, vs := range data {
for _, v := range vs {
tx.AddGetRequestArgument(k, v)
Expand Down

0 comments on commit 0640eed

Please sign in to comment.