From 6d6e91867ce67f2c4e3f3db47a14173fa3bb598d Mon Sep 17 00:00:00 2001 From: Serghei Cebotari Date: Thu, 2 Nov 2023 23:31:17 +0300 Subject: [PATCH] Use UriBuilder to create request uri --- RhSolutions.AddIn/Services/DatabaseClient.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/RhSolutions.AddIn/Services/DatabaseClient.cs b/RhSolutions.AddIn/Services/DatabaseClient.cs index ac4dfa5..69f7fc1 100644 --- a/RhSolutions.AddIn/Services/DatabaseClient.cs +++ b/RhSolutions.AddIn/Services/DatabaseClient.cs @@ -54,7 +54,11 @@ public class DatabaseClient : IDatabaseClient else { - string request = @"https://rh.cebotari.ru/api/search?query=" + line; + UriBuilder builder = new(@"https://rh.cebotari.ru/api/search") + { + Query = $"query={line.Replace("&", "%26")}" + }; + string request = builder.Uri.AbsoluteUri; if (!_memoryCache.TryGetValue(line, out IEnumerable products)) {