mirror of
https://github.com/Jackett/Jackett
synced 2025-02-23 14:51:01 +00:00
Make parameter type HttpRequest
Code tidy
This commit is contained in:
parent
e7d9360b51
commit
6ac9555cb5
3 changed files with 25 additions and 27 deletions
|
@ -15,6 +15,7 @@
|
|||
<PackageReference Include="CommandLineParser" Version="2.4.3" />
|
||||
<PackageReference Include="CsQuery.NETStandard" Version="1.3.6.1" />
|
||||
<PackageReference Include="DotNet4.SocksProxy" Version="1.4.0.1" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Http" Version="2.2.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.WebUtilities" Version="2.2.0" />
|
||||
<PackageReference Include="Microsoft.CSharp" Version="4.5.0" />
|
||||
<PackageReference Include="MimeMapping" Version="1.0.1.12" />
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Net.Http;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
|
||||
namespace Jackett.Common.Services.Interfaces
|
||||
{
|
||||
|
@ -12,7 +12,7 @@ namespace Jackett.Common.Services.Interfaces
|
|||
void ReserveUrls(bool doInstall = true);
|
||||
Uri ConvertToProxyLink(Uri link, string serverUrl, string indexerId, string action = "dl", string file = "t");
|
||||
string BasePath();
|
||||
string GetServerUrl(object Request); //TODO: Once Mono is removed, change type to HttpRequest
|
||||
string GetServerUrl(HttpRequest Request);
|
||||
List<string> notices { get; }
|
||||
string GetBlackholeDirectory();
|
||||
string GetApiKey();
|
||||
|
|
|
@ -314,12 +314,10 @@ namespace Jackett.Server.Services
|
|||
// Only needed for Owin
|
||||
}
|
||||
|
||||
public string GetServerUrl(Object obj)
|
||||
public string GetServerUrl(HttpRequest request)
|
||||
{
|
||||
string serverUrl = "";
|
||||
|
||||
if (obj is HttpRequest request)
|
||||
{
|
||||
var scheme = request.Scheme;
|
||||
var port = request.HttpContext.Request.Host.Port;
|
||||
|
||||
|
@ -343,7 +341,6 @@ namespace Jackett.Server.Services
|
|||
}
|
||||
|
||||
serverUrl = string.Format("{0}://{1}:{2}{3}/", scheme, request.HttpContext.Request.Host.Host, port, BasePath());
|
||||
}
|
||||
|
||||
return serverUrl;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue