mirror of
https://github.com/openfaas/faas.git
synced 2025-06-22 06:43:23 +00:00
Trim tailing slash from service name before proxy
**What** - When determining the service name of the function, remove any trailing slashes, the slashes are not allowed in service names for either Swarm or K8S, so this can only be a left over from the url path **Why** - This was preventing service resolution, and hence failed functions, when the function was called with a trailing slash Fixes #714 Signed-off-by: Lucas Roesler <roesler.lucas@gmail.com>
This commit is contained in:
committed by
Alex Ellis
parent
1f6e174454
commit
6676d1b807
@ -133,7 +133,7 @@ func getServiceName(urlValue string) string {
|
||||
if strings.HasPrefix(urlValue, forward) {
|
||||
serviceName = urlValue[len(forward):]
|
||||
}
|
||||
return serviceName
|
||||
return strings.Trim(serviceName, "/")
|
||||
}
|
||||
|
||||
// LoggingNotifier notifies a log about a request
|
||||
@ -168,7 +168,6 @@ type FunctionAsHostBaseURLResolver struct {
|
||||
|
||||
// Resolve the base URL for a request
|
||||
func (f FunctionAsHostBaseURLResolver) Resolve(r *http.Request) string {
|
||||
|
||||
svcName := getServiceName(r.URL.Path)
|
||||
|
||||
const watchdogPort = 8080
|
||||
|
Reference in New Issue
Block a user