mirror of
https://github.com/openfaas/faas.git
synced 2025-06-20 13:06:40 +00:00
Allow override of HTTP port via env-var
HTTP port can now be overriden through use of "port" environmental variable. Prefer messaging "want" over "wanted" in error messages, this is more idiomatic Golang. Move away from Go ARMv6 (RPi Zero) and give ARMv7 as a minimum version for release binaries. Signed-off-by: Alex Ellis (VMware) <alexellis2@gmail.com>
This commit is contained in:
@ -193,6 +193,7 @@ func pipeRequest(config *WatchdogConfig, w http.ResponseWriter, r *http.Request,
|
||||
header := w.Header()
|
||||
debugHeaders(&header, "out")
|
||||
}
|
||||
|
||||
if len(bytesWritten) > 0 {
|
||||
log.Printf("%s - Duration: %f seconds", bytesWritten, execTime)
|
||||
} else {
|
||||
@ -205,6 +206,7 @@ func getAdditionalEnvs(config *WatchdogConfig, r *http.Request, method string) [
|
||||
|
||||
if config.cgiHeaders {
|
||||
envs = os.Environ()
|
||||
|
||||
for k, v := range r.Header {
|
||||
kv := fmt.Sprintf("Http_%s=%s", strings.Replace(k, "-", "_", -1), v[0])
|
||||
envs = append(envs, kv)
|
||||
@ -216,6 +218,7 @@ func getAdditionalEnvs(config *WatchdogConfig, r *http.Request, method string) [
|
||||
if config.writeDebug {
|
||||
log.Println("Query ", r.URL.RawQuery)
|
||||
}
|
||||
|
||||
if len(r.URL.RawQuery) > 0 {
|
||||
envs = append(envs, fmt.Sprintf("Http_Query=%s", r.URL.RawQuery))
|
||||
}
|
||||
@ -223,6 +226,7 @@ func getAdditionalEnvs(config *WatchdogConfig, r *http.Request, method string) [
|
||||
if config.writeDebug {
|
||||
log.Println("Path ", r.URL.Path)
|
||||
}
|
||||
|
||||
if len(r.URL.Path) > 0 {
|
||||
envs = append(envs, fmt.Sprintf("Http_Path=%s", r.URL.Path))
|
||||
}
|
||||
|
Reference in New Issue
Block a user