Your ROOT_URL in app.ini is https://git.cloudchain.link/ but you are visiting https://dash.bss.nz/open-source-mirrors/Readarr/commit/2b11ad4585f9caaa050b58077da56bca37764049
You should set ROOT_URL correctly, otherwise the web may not work correctly.
6 changed files with
55 additions and
6 deletions
@ -25,13 +25,21 @@ namespace NzbDrone.Common.Http.Proxy
public string BypassFilter { get ; private set ; }
public bool BypassLocalAddress { get ; private set ; }
public string [ ] SubnetFilter AsArray
public string [ ] BypassList AsArray
{
get
{
if ( ! string . IsNullOrWhiteSpace ( BypassFilter ) )
{
return BypassFilter . Split ( ';' ) ;
var hostlist = BypassFilter . Split ( ',' ) ;
for ( int i = 0 ; i < hostlist . Length ; i + + )
{
if ( hostlist [ i ] . StartsWith ( "*" ) )
{
hostlist [ i ] = ";" + hostlist [ i ] ;
}
}
return hostlist ;
}
return new string [ ] { } ;
}
@ -40,11 +40,11 @@ namespace NzbDrone.Common.Http.Proxy
case ProxyType . Http :
if ( proxySettings . Username . IsNotNullOrWhiteSpace ( ) & & proxySettings . Password . IsNotNullOrWhiteSpace ( ) )
{
return new WebProxy ( proxySettings . Host + ":" + proxySettings . Port , proxySettings . BypassLocalAddress , proxySettings . SubnetFilter AsArray, new NetworkCredential ( proxySettings . Username , proxySettings . Password ) ) ;
return new WebProxy ( proxySettings . Host + ":" + proxySettings . Port , proxySettings . BypassLocalAddress , proxySettings . BypassList AsArray, new NetworkCredential ( proxySettings . Username , proxySettings . Password ) ) ;
}
else
{
return new WebProxy ( proxySettings . Host + ":" + proxySettings . Port , proxySettings . BypassLocalAddress , proxySettings . SubnetFilter AsArray) ;
return new WebProxy ( proxySettings . Host + ":" + proxySettings . Port , proxySettings . BypassLocalAddress , proxySettings . BypassList AsArray) ;
}
case ProxyType . Socks4 :
return new SocksWebProxy ( new ProxyConfig ( IPAddress . Loopback , GetNextFreePort ( ) , GetProxyIpAddress ( proxySettings . Host ) , proxySettings . Port , ProxyConfig . SocksVersion . Four , proxySettings . Username , proxySettings . Password ) , false ) ;
@ -0,0 +1,40 @@
using NzbDrone.Core.Http ;
using System ;
using System.Collections.Generic ;
using System.Linq ;
using System.Text ;
using NUnit.Framework ;
using FluentAssertions ;
using NzbDrone.Test.Common ;
using NzbDrone.Common.Http.Proxy ;
using NzbDrone.Common.Http ;
namespace NzbDrone.Core.Test.Http
{
[TestFixture]
public class HttpProxySettingsProviderFixture : TestBase < HttpProxySettingsProvider >
{
private HttpProxySettings GetProxySettings ( )
{
return new HttpProxySettings ( ProxyType . Socks5 , "localhost" , 8080 , "*.httpbin.org,google.com" , true , null , null ) ;
}
[Test]
public void should_bypass_proxy ( )
{
var settings = GetProxySettings ( ) ;
Subject . ShouldProxyBeBypassed ( settings , new HttpUri ( "http://eu.httpbin.org/get" ) ) . Should ( ) . BeTrue ( ) ;
Subject . ShouldProxyBeBypassed ( settings , new HttpUri ( "http://google.com/get" ) ) . Should ( ) . BeTrue ( ) ;
Subject . ShouldProxyBeBypassed ( settings , new HttpUri ( "http://localhost:8654/get" ) ) . Should ( ) . BeTrue ( ) ;
}
[Test]
public void should_not_bypass_proxy ( )
{
var settings = GetProxySettings ( ) ;
Subject . ShouldProxyBeBypassed ( settings , new HttpUri ( "http://bing.com/get" ) ) . Should ( ) . BeFalse ( ) ;
}
}
}
@ -217,6 +217,7 @@
<Compile Include= "Housekeeping\Housekeepers\CleanupOrphanedMetadataFilesFixture.cs" />
<Compile Include= "Housekeeping\Housekeepers\CleanupOrphanedPendingReleasesFixture.cs" />
<Compile Include= "Housekeeping\Housekeepers\FixFutureRunScheduledTasksFixture.cs" />
<Compile Include= "Http\HttpProxySettingsProviderFixture.cs" />
<Compile Include= "Http\TorCacheHttpRequestInterceptorFixture.cs" />
<Compile Include= "IndexerSearchTests\SeriesSearchServiceFixture.cs" />
<Compile Include= "IndexerSearchTests\NzbSearchServiceFixture.cs" />
@ -41,7 +41,7 @@ namespace NzbDrone.Core.Http
public bool ShouldProxyBeBypassed ( HttpProxySettings proxySettings , HttpUri url )
{
//We are utilising the WebProxy implementation here to save us having to reimplement it. This way we use Microsofts implementation
var proxy = new WebProxy ( proxySettings . Host + ":" + proxySettings . Port , proxySettings . BypassLocalAddress , proxySettings . SubnetFilter AsArray) ;
var proxy = new WebProxy ( proxySettings . Host + ":" + proxySettings . Port , proxySettings . BypassLocalAddress , proxySettings . BypassList AsArray) ;
return proxy . IsBypassed ( ( Uri ) url ) ;
}
@ -242,7 +242,7 @@
<label class="col-sm-3 control-label">Addresses for the proxy to ignore</label>
<div class="col-sm-1 col-sm-push-4 help-inline">
<i class="icon-sonarr-form-info" title="Use ' ;' as a separator "/>
<i class="icon-sonarr-form-info" title="Use ' ,' as a separator, and '*.' as a wildcard for subdomains "/>
</div>
<div class="col-sm-4 col-sm-pull-1">