mirror of
https://github.com/openfaas/faas.git
synced 2025-06-18 12:06:37 +00:00
Make 'URLPathTransformer' interface and implementation to do the function prefix trimming instead of baking it in. Also add a configuration option, 'pass_url_path_to_functions' to control whether the full path is passed to the functions or not.
Signed-off-by: Thomas E Lackey <telackey@bozemanpass.com>
This commit is contained in:
committed by
Alex Ellis
parent
7870b87c38
commit
decf9addb3
@ -164,7 +164,10 @@ func Test_buildUpstreamRequest_Body_Method_Query_Path(t *testing.T) {
|
||||
t.Fail()
|
||||
}
|
||||
|
||||
upstream := buildUpstreamRequest(request, "http://xyz:8080", request.URL.Path)
|
||||
transformer := FunctionPrefixTrimmingURLPathTransformer{}
|
||||
transformedPath := transformer.Transform(request)
|
||||
|
||||
upstream := buildUpstreamRequest(request, "http://xyz:8080", transformedPath)
|
||||
|
||||
if request.Method != upstream.Method {
|
||||
t.Errorf("Method - want: %s, got: %s", request.Method, upstream.Method)
|
||||
|
Reference in New Issue
Block a user