Skip to content

Commit

Permalink
fix missing eq sign (#4513)
Browse files Browse the repository at this point in the history
  • Loading branch information
dogancanbakir authored Dec 20, 2023
1 parent d07f31f commit e6133ef
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/protocols/http/raw/raw.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ func Parse(request string, inputURL *urlutil.URL, unsafe, disablePathAutomerge b
// can be omitted but makes things clear
case rawrequest.Path == "":
if !disablePathAutomerge {
inputURL.Params.IncludeEquals = true
rawrequest.Path = inputURL.GetRelativePath()
}

Expand All @@ -47,6 +48,7 @@ func Parse(request string, inputURL *urlutil.URL, unsafe, disablePathAutomerge b
return nil, errorutil.NewWithErr(err).WithTag("raw").Msgf("failed to parse url %v from template", rawrequest.Path)
}
cloned := inputURL.Clone()
cloned.Params.IncludeEquals = true
if disablePathAutomerge {
cloned.Path = ""
}
Expand All @@ -59,6 +61,7 @@ func Parse(request string, inputURL *urlutil.URL, unsafe, disablePathAutomerge b
case unsafe:
prevPath := rawrequest.Path
cloned := inputURL.Clone()
cloned.Params.IncludeEquals = true
unsafeRelativePath := ""
if (cloned.Path == "" || cloned.Path == "/") && !strings.HasPrefix(prevPath, "/") {
// Edgecase if raw unsafe request is
Expand Down Expand Up @@ -90,6 +93,7 @@ func Parse(request string, inputURL *urlutil.URL, unsafe, disablePathAutomerge b

default:
cloned := inputURL.Clone()
cloned.Params.IncludeEquals = true
if disablePathAutomerge {
cloned.Path = ""
}
Expand All @@ -105,6 +109,7 @@ func Parse(request string, inputURL *urlutil.URL, unsafe, disablePathAutomerge b
rawrequest.Headers["Host"] = inputURL.Host
}
cloned := inputURL.Clone()
cloned.Params.IncludeEquals = true
cloned.Path = ""
_ = cloned.MergePath(rawrequest.Path, true)
rawrequest.FullURL = cloned.String()
Expand Down

0 comments on commit e6133ef

Please sign in to comment.