mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-21 05:43:19 -07:00
Fixed #22
With the understanding that most people will not have a valid cert or self signed cert I have disabled the SSL warnings. Added a SSL option to the Plex settings and added unit test to cover this.
This commit is contained in:
parent
07b42ffd50
commit
e6d67c7320
6 changed files with 41 additions and 8 deletions
|
@ -48,8 +48,6 @@ namespace PlexRequests.Helpers
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Returns the URI.
|
||||
/// </summary>
|
||||
|
@ -57,7 +55,7 @@ namespace PlexRequests.Helpers
|
|||
/// <param name="port">The port.</param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="System.Exception"></exception>
|
||||
public static Uri ReturnUri(this string val, int port)
|
||||
public static Uri ReturnUri(this string val, int port, bool ssl = default(bool))
|
||||
{
|
||||
if (val == null)
|
||||
{
|
||||
|
@ -75,7 +73,13 @@ namespace PlexRequests.Helpers
|
|||
else if (val.StartsWith("https://", StringComparison.Ordinal))
|
||||
{
|
||||
var split = val.Split('/');
|
||||
uri = split.Length >= 4 ? new UriBuilder(Uri.UriSchemeHttps, split[2], port, "/" + split[3]) : new UriBuilder(Uri.UriSchemeHttps, split[2], port);
|
||||
uri = split.Length >= 4
|
||||
? new UriBuilder(Uri.UriSchemeHttps, split[2], port, "/" + split[3])
|
||||
: new UriBuilder(Uri.UriSchemeHttps, split[2], port);
|
||||
}
|
||||
else if(ssl)
|
||||
{
|
||||
uri = new UriBuilder(Uri.UriSchemeHttps, val, port);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue