Skip to content

Commit

Permalink
chore: copy readiness headers to the upstream request
Browse files Browse the repository at this point in the history
When proxying the readiness request to the upstream function, we should
copy the original request headers. This allows the handler to use
headers, if needed. It also allows the of-watchdog to suppress the noisy
request logging for readiness checks.

Signed-off-by: Lucas Roesler <roesler.lucas@gmail.com>
  • Loading branch information
LucasRoesler authored and alexellis committed Oct 14, 2022
1 parent 42bfe89 commit 276e3b7
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,7 @@ func (r *readiness) ServeHTTP(w http.ResponseWriter, req *http.Request) {
// we need to set the raw RequestURI for the function invoker to see our URL path,
// otherwise it will just route to `/`, typically this shouldn't be used or set
readyReq.RequestURI = r.endpoint
readyReq.Header = req.Header.Clone()
r.functionHandler.ServeHTTP(w, readyReq)
return
}
Expand Down

0 comments on commit 276e3b7

Please sign in to comment.