Skip to content

Commit c96acf7

Browse files
telackeyalexellis
authored andcommitted
Simplify by having the Gateway strip the initial part of the URL for us.
Signed-off-by: Thomas E Lackey <[email protected]>
1 parent 016033b commit c96acf7

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

executor/http_runner.go

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import (
1010
"net/url"
1111
"os"
1212
"os/exec"
13-
"regexp"
1413
"sync"
1514
"time"
1615
)
@@ -99,13 +98,8 @@ func (f *HTTPFunctionRunner) Run(req FunctionRequest, contentLength int64, r *ht
9998

10099
upstreamURL := f.UpstreamURL.String()
101100

102-
matcher, _ := regexp.Compile("/?function/([^/?]+)(.*)")
103-
parts := matcher.FindStringSubmatch(r.RequestURI)
104-
105-
// The first is the original string, the second the function name
106-
// and the third anything else on the path, including the query string
107-
if 3 == len(parts) {
108-
upstreamURL += parts[2]
101+
if len(r.RequestURI) > 0 {
102+
upstreamURL += r.RequestURI
109103
}
110104

111105
request, _ := http.NewRequest(r.Method, upstreamURL, r.Body)

0 commit comments

Comments
 (0)