Skip to content

Commit

Permalink
fix unsafe quoting (#243)
Browse files Browse the repository at this point in the history
Signed-off-by: KfreeZ <[email protected]>
  • Loading branch information
KfreeZ authored Jul 31, 2024
1 parent d3fc939 commit aa2730a
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -409,10 +409,11 @@ func reconcileRouterService(ctx context.Context, client client.Client, graph *mc
return errors.Wrapf(err, "Failed to Marshal routes for %s", graph.Spec.RouterConfig.Name)
}
jsonString := string(jsonBytes)
escapedString := strings.ReplaceAll(jsonString, "'", "\\'")
if graph.Spec.RouterConfig.Config == nil {
graph.Spec.RouterConfig.Config = make(map[string]string)
}
graph.Spec.RouterConfig.Config["nodes"] = "'" + jsonString + "'"
graph.Spec.RouterConfig.Config["nodes"] = "'" + escapedString + "'"
routerSvcName := graph.Spec.RouterConfig.ServiceName

templateBytes, err := getTemplateBytes(Router)
Expand Down

0 comments on commit aa2730a

Please sign in to comment.