mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-05-30 18:01:14 +00:00
Flatten the observables for releases
This commit is contained in:
@@ -26,10 +26,10 @@ namespace Octokit
|
||||
return new Uri(string.Format(CultureInfo.InvariantCulture, pattern, args), UriKind.Relative);
|
||||
}
|
||||
|
||||
static Regex OptionalQueryStringRegex = new Regex("\\{\\?([^}]+)\\}");
|
||||
static readonly Regex _optionalQueryStringRegex = new Regex("\\{\\?([^}]+)\\}");
|
||||
public static Uri ExpandUriTemplate(this string template, object values)
|
||||
{
|
||||
var optionalQueryStringMatch = OptionalQueryStringRegex.Match(template);
|
||||
var optionalQueryStringMatch = _optionalQueryStringRegex.Match(template);
|
||||
if(optionalQueryStringMatch.Success)
|
||||
{
|
||||
var expansion = "";
|
||||
@@ -39,7 +39,7 @@ namespace Octokit
|
||||
{
|
||||
expansion = "?" + parameterName + "=" + Uri.EscapeDataString("" + parameterProperty.GetValue(values, new object[0]));
|
||||
}
|
||||
template = OptionalQueryStringRegex.Replace(template, expansion);
|
||||
template = _optionalQueryStringRegex.Replace(template, expansion);
|
||||
}
|
||||
return new Uri(template);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user