Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: bug
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Start Container
2. Send Request
3. [...]

**Expected behavior**
A clear and concise description of what you expected to happen.

**Additional context**
Add any other context about the problem here.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: enhancement
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
20 changes: 12 additions & 8 deletions internals/proxy/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ type AuthType string

const (
Bearer AuthType = "Bearer"
Basic AuthType = "Basic"
Query AuthType = "Query"
None AuthType = "None"
Basic AuthType = "Basic"
Query AuthType = "Query"
None AuthType = "None"
)

func parseTypedQuery(values []string) interface{} {
Expand Down Expand Up @@ -96,8 +96,8 @@ func templateJSON(data map[string]interface{}, variables map[string]interface{})
matches := re.FindAllStringSubmatch(str, -1)

if len(matches) > 1 {
for i, tmplStr := range(matches) {
for i, tmplStr := range matches {

tmplKey := matches[i][1]

variable, err := json.Marshal(variables[tmplKey])
Expand Down Expand Up @@ -234,15 +234,19 @@ func TemplatingMiddleware(next http.Handler, VARIABLES map[string]interface{}) h
modifiedBodyData = templateJSON(modifiedBodyData, VARIABLES)

if req.URL.RawQuery != "" {
query, _ := renderTemplate("query", req.URL.RawQuery, VARIABLES)
decodedQuery, _ := url.QueryUnescape(req.URL.RawQuery)

log.Debug("Decoded Query: ", decodedQuery)

query, _ := renderTemplate("query", decodedQuery, VARIABLES)

modifiedQuery := req.URL.Query()

queryData, _ := url.ParseQuery(query)

for key, value := range queryData {
keyWithoutPrefix, found := strings.CutPrefix(key, "@")

if found {
modifiedBodyData[keyWithoutPrefix] = parseTypedQuery(value)

Expand Down Expand Up @@ -290,4 +294,4 @@ func Create(targetUrl string) *httputil.ReverseProxy {
proxy := httputil.NewSingleHostReverseProxy(url)

return proxy
}
}