Skip to content

Commit

Permalink
Merge pull request #318 from zapadi/enable-schema-set
Browse files Browse the repository at this point in the history
Enabled schema set
  • Loading branch information
zapadi authored Mar 28, 2023
2 parents 82b030f + f129d10 commit 810480c
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions src/redmine-net-api/RedmineManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public class RedmineManager : IRedmineManager
public RedmineManager(string host, MimeFormat mimeFormat = MimeFormat.Xml, bool verifyServerCert = true,
IWebProxy proxy = null, SecurityProtocolType securityProtocolType = default, string scheme = "https", TimeSpan? timeout = null)
{
if (string.IsNullOrEmpty(host))
if (host.IsNullOrWhiteSpace())
{
throw new RedmineException("Host is not defined!");
}
Expand Down Expand Up @@ -163,11 +163,12 @@ public RedmineManager(string host, MimeFormat mimeFormat = MimeFormat.Xml, bool
/// <param name="verifyServerCert">if set to <c>true</c> [verify server cert].</param>
/// <param name="proxy">The proxy.</param>
/// <param name="securityProtocolType">Use this parameter to specify a SecurityProtcolType. Note: it is recommended to leave this parameter at its default value as this setting also affects the calling application process.</param>
/// <param name="scheme"></param>
/// <param name="timeout">The webclient timeout. Default is 100 seconds.</param>
public RedmineManager(string host, string apiKey, MimeFormat mimeFormat = MimeFormat.Xml,
bool verifyServerCert = true, IWebProxy proxy = null,
SecurityProtocolType securityProtocolType = default, TimeSpan? timeout = null)
: this(host, mimeFormat, verifyServerCert, proxy, securityProtocolType, timeout: timeout)
bool verifyServerCert = true, IWebProxy proxy = null,
SecurityProtocolType securityProtocolType = default, string scheme = "https", TimeSpan? timeout = null)
: this(host, mimeFormat, verifyServerCert, proxy, securityProtocolType, scheme, timeout: timeout)
{
ApiKey = apiKey;
}
Expand All @@ -193,11 +194,13 @@ public RedmineManager(string host, string apiKey, MimeFormat mimeFormat = MimeFo
/// <param name="verifyServerCert">if set to <c>true</c> [verify server cert].</param>
/// <param name="proxy">The proxy.</param>
/// <param name="securityProtocolType">Use this parameter to specify a SecurityProtcolType. Note: it is recommended to leave this parameter at its default value as this setting also affects the calling application process.</param>
/// <param name="scheme"></param>
/// <param name="timeout">The webclient timeout. Default is 100 seconds.</param>
public RedmineManager(string host, string login, string password, MimeFormat mimeFormat = MimeFormat.Xml,
bool verifyServerCert = true, IWebProxy proxy = null,
SecurityProtocolType securityProtocolType = default, TimeSpan? timeout = null)
: this(host, mimeFormat, verifyServerCert, proxy, securityProtocolType, timeout: timeout)
bool verifyServerCert = true, IWebProxy proxy = null,
SecurityProtocolType securityProtocolType = default, string scheme = "https", TimeSpan? timeout = null)
: this(host, mimeFormat, verifyServerCert, proxy, securityProtocolType, scheme, timeout: timeout)

{
cache = new CredentialCache { { new Uri(host), "Basic", new NetworkCredential(login, password) } };

Expand Down Expand Up @@ -244,6 +247,11 @@ private set
if (Uri.TryCreate(host, UriKind.Absolute, out Uri uriResult) &&
(uriResult.Scheme == Uri.UriSchemeHttp || uriResult.Scheme == Uri.UriSchemeHttps))
{
if (Scheme.IsNullOrWhiteSpace())
{
Scheme = uriResult.Scheme;
}

return;
}

Expand Down

0 comments on commit 810480c

Please sign in to comment.