-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
patrofimov
committed
Aug 26, 2024
1 parent
a0b4d37
commit 68462d3
Showing
7 changed files
with
65 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
Vostok.ClusterClient.Core/Model/RequestUrlParsingHelpers.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
using System; | ||
using JetBrains.Annotations; | ||
|
||
namespace Vostok.Clusterclient.Core.Model | ||
{ | ||
internal static class RequestUrlParsingHelpers | ||
{ | ||
public static bool TryParseUrlPath([CanBeNull] string url, out string path, out int questionInd) | ||
{ | ||
path = null; | ||
questionInd = -1; | ||
|
||
if (url == null) | ||
return false; | ||
|
||
questionInd = url.IndexOf("?", StringComparison.Ordinal); | ||
if (questionInd < 0) | ||
{ | ||
path = url; | ||
return true; | ||
} | ||
|
||
path = url.Substring(0, questionInd); | ||
|
||
return true; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters