diff --git a/README.md b/README.md index b0ddd1d..73ce87f 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ plugin: Request: ```json { - "url": "https://rout-to-app.domain.com/volume1" + "request": "https://route-to-app.domain.com/volume1" } ``` diff --git a/router.go b/router.go index 0581fb3..45b5c93 100644 --- a/router.go +++ b/router.go @@ -82,7 +82,7 @@ func (a *Router) ServeHTTP(rw http.ResponseWriter, req *http.Request) { log.Println(fmt.Sprintf("Resolving header for %s", req.URL)) requestBody, err := json.Marshal(map[string]string{ - "url": fmt.Sprintf("%s", req.URL), + "request": fmt.Sprintf("%s", req.URL), }) if err != nil { log.Println("Requestbody marshalling error.") @@ -146,9 +146,7 @@ func (a *Router) ServeHTTP(rw http.ResponseWriter, req *http.Request) { continue } - fmt.Println(rewrite.Template) t := addDollarSigns(rewrite.Template) - fmt.Println(string(t)) if check.Match([]byte(req.URL.Path)) { newpath := check.ReplaceAll([]byte(req.URL.Path), t) diff --git a/router_test.go b/router_test.go index 0f1d32c..ef94060 100644 --- a/router_test.go +++ b/router_test.go @@ -14,7 +14,7 @@ import ( ) type UrlResponse struct { - Url string `json:"url,omitempty"` + Request string `json:"request,omitempty"` } func TestRouter(t *testing.T) { @@ -105,7 +105,7 @@ func TestRouter(t *testing.T) { body, _ := ioutil.ReadAll(r.Body) urlresponse := &UrlResponse{} _ = json.Unmarshal(body, urlresponse) - u, _:= url.Parse(urlresponse.Url) + u, _:= url.Parse(urlresponse.Request) if u.Path == "/test1" { w.Write(body1) } else if u.Path == "/test2/path/rewritepart/bla" {