From d8889fa8c4cc97247072576d908f063d44ca8051 Mon Sep 17 00:00:00 2001 From: aorzelskiGH Date: Thu, 6 Jun 2024 17:16:53 +0200 Subject: [PATCH] Fix URL replace --- src/AasxServerBlazor/Shared/MainLayout.razor | 2 +- .../Services/RegistryInitializerService.cs | 28 ++++++++++++++++--- 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/src/AasxServerBlazor/Shared/MainLayout.razor b/src/AasxServerBlazor/Shared/MainLayout.razor index 8f608fdd6..1473720dc 100644 --- a/src/AasxServerBlazor/Shared/MainLayout.razor +++ b/src/AasxServerBlazor/Shared/MainLayout.razor @@ -322,7 +322,7 @@ if (replace != "") registryURL = replace; } - link += registryURL; + link += "®istryURL=" + registryURL; } queryPara = ""; diff --git a/src/IO.Swagger.Registry.Lib.V3/Services/RegistryInitializerService.cs b/src/IO.Swagger.Registry.Lib.V3/Services/RegistryInitializerService.cs index 60799c176..e0afcf293 100644 --- a/src/IO.Swagger.Registry.Lib.V3/Services/RegistryInitializerService.cs +++ b/src/IO.Swagger.Registry.Lib.V3/Services/RegistryInitializerService.cs @@ -203,6 +203,16 @@ public void InitRegistry(List cList, DateTime timestamp, b // basyx with Submodel Registry: read submodel descriptors string requestPath = submodelRegistryUrl + "/submodel-descriptors"; + string queryPara = ""; + string userPW = ""; + string urlEdcWrapper = ""; + string replace = ""; + + if (AasxCredentials.get(cs.credentials, requestPath, out queryPara, out userPW, out urlEdcWrapper, out replace)) + { + if (replace != "") + requestPath = replace; + } var handler = new HttpClientHandler(); @@ -279,6 +289,16 @@ public void InitRegistry(List cList, DateTime timestamp, b string accessToken = null; //string requestPath = greg + "/" + "registry/shell-descriptors"; string requestPath = greg + "/shell-descriptors"; + string queryPara = ""; + string userPW = ""; + string urlEdcWrapper = ""; + string replace = ""; + + if (AasxCredentials.get(cs.credentials, requestPath, out queryPara, out userPW, out urlEdcWrapper, out replace)) + { + if (replace != "") + requestPath = replace; + } var handler = new HttpClientHandler(); @@ -422,10 +442,10 @@ public void InitRegistry(List cList, DateTime timestamp, b } } requestPath = endpoint; - string queryPara = ""; - string userPW = ""; - string urlEdcWrapper = ""; - string replace = ""; + queryPara = ""; + userPW = ""; + urlEdcWrapper = ""; + replace = ""; client.DefaultRequestHeaders.Clear(); if (AasxCredentials.get(cList, requestPath, out queryPara, out userPW, out urlEdcWrapper, out replace)) {