Your ROOT_URL in app.ini is https://git.cloudchain.link/ but you are visiting https://dash.bss.nz/open-source-mirrors/Prowlarr/commit/a997c10ca147db0b0b49e96eda439d2d82057ff1
You should set ROOT_URL correctly, otherwise the web may not work correctly.
4 changed files with
16 additions and
8 deletions
@ -6,12 +6,12 @@ using NzbDrone.Test.Common;
namespace NzbDrone.Common.Test
{
[TestFixture]
public class WebClientTests : TestBase
public class WebClientTests : TestBase < HttpProvider >
{
[Test]
public void DownloadString_should_be_able_to_dowload_text_file ( )
{
var jquery = new HttpProvider ( new EnvironmentProvider ( ) ) . DownloadString ( "http://www.google.com/robots.txt" ) ;
var jquery = Subject . DownloadString ( "http://www.google.com/robots.txt" ) ;
jquery . Should ( ) . NotBeBlank ( ) ;
jquery . Should ( ) . Contain ( "Sitemap" ) ;
@ -23,7 +23,15 @@ namespace NzbDrone.Common.Test
[ExpectedException]
public void DownloadString_should_throw_on_error ( string url )
{
var jquery = new HttpProvider ( new EnvironmentProvider ( ) ) . DownloadString ( url ) ;
var jquery = Subject . DownloadString ( url ) ;
}
[Test]
public void should_get_headers ( )
{
Subject . GetHeader ( "http://www.google.com" ) . Should ( ) . NotBeEmpty ( ) ;
}
}
}
@ -13,7 +13,7 @@ namespace NzbDrone.Common
string DownloadString ( string address ) ;
string DownloadString ( string address , string username , string password ) ;
string DownloadString ( string address , ICredentials identity ) ;
Dictionary < string , string > Download Header( string url ) ;
Dictionary < string , string > Get Header( string url ) ;
Stream DownloadStream ( string url , NetworkCredential credential = null ) ;
void DownloadFile ( string url , string fileName ) ;
@ -60,7 +60,7 @@ namespace NzbDrone.Common
}
}
public Dictionary < string , string > Download Header( string url )
public Dictionary < string , string > Get Header( string url )
{
var headers = new Dictionary < string , string > ( ) ;
var request = WebRequest . Create ( url ) ;
@ -68,7 +68,7 @@ namespace NzbDrone.Common
var response = request . GetResponse ( ) ;
foreach ( var key in headers. Keys)
foreach ( var key in response. Headers . All Keys)
{
headers . Add ( key , response . Headers [ key ] ) ;
}
@ -19,7 +19,7 @@ namespace NzbDrone.Core.Test.MediaCoverTests
{
_headers = new Dictionary < string , string > ( ) ;
Mocker . GetMock < IDiskProvider > ( ) . Setup ( c = > c . GetFileSize ( It . IsAny < string > ( ) ) ) . Returns ( 100 ) ;
Mocker . GetMock < IHttpProvider > ( ) . Setup ( c = > c . Download Header( It . IsAny < string > ( ) ) ) . Returns ( _headers ) ;
Mocker . GetMock < IHttpProvider > ( ) . Setup ( c = > c . Get Header( It . IsAny < string > ( ) ) ) . Returns ( _headers ) ;
}
@ -29,7 +29,7 @@ namespace NzbDrone.Core.MediaCover
return false ;
}
var headers = _httpProvider . Download Header( url ) ;
var headers = _httpProvider . Get Header( url ) ;
string sizeString ;