Skip to content
Snippets Groups Projects
Commit 8c0bfd0a authored by Malte Bauch's avatar Malte Bauch
Browse files

String replacement for path in GetPath()

A GetPath request triggered from the grpc-gateway proxy needs other
formatting for path. The `||` is replaced back to `/`.
parent 3f85d0ee
Branches
No related tags found
1 merge request!238Stfaseid http refactor
Pipeline #96614 failed
This commit is part of merge request !238. Comments created here will be created in the context of that merge request.
......@@ -2,6 +2,7 @@ package server
import (
"context"
"strings"
"time"
ppb "code.fbi.h-da.de/danet/api/go/gosdn/pnd"
......@@ -259,7 +260,11 @@ func (p pndServer) GetPath(ctx context.Context, request *ppb.GetPathRequest) (*p
log.Error(err)
return nil, status.Errorf(codes.Aborted, "%v", err)
}
_, err = pnd.Request(duid, request.Path)
// In case we get the path from grpc-gateway we have to replace
path := strings.ReplaceAll(request.Path, "||", "/")
_, err = pnd.Request(duid, path)
if err != nil {
log.Error(err)
return nil, status.Errorf(codes.Aborted, "%v", err)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment