Skip to content

Commit

Permalink
Fix #18 and pass QueryString for HTTP mode
Browse files Browse the repository at this point in the history
Fixes #18 by passing QueryString when defined and running in the
HTTP Mode.

Signed-off-by: Alex Ellis (VMware) <alexellis2@gmail.com>
  • Loading branch information
alexellis committed May 16, 2018
1 parent f7fef98 commit 7805183
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,7 @@
of-watchdog
nodejs-afterburn
faster
of-watchdog*
of-watchdog*
build
template

8 changes: 7 additions & 1 deletion executor/http_runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,13 @@ func (f *HTTPFunctionRunner) Start() error {
// Run a function with a long-running process with a HTTP protocol for communication
func (f *HTTPFunctionRunner) Run(req FunctionRequest, contentLength int64, r *http.Request, w http.ResponseWriter) error {

request, _ := http.NewRequest(r.Method, f.UpstreamURL.String(), r.Body)
upstreamURL := f.UpstreamURL.String()

if len(r.URL.RawQuery) > 0 {
upstreamURL += "?" + r.URL.RawQuery
}

request, _ := http.NewRequest(r.Method, upstreamURL, r.Body)
for h := range r.Header {
request.Header.Set(h, r.Header.Get(h))
}
Expand Down

0 comments on commit 7805183

Please sign in to comment.