mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2026-04-23 22:45:06 -04:00
New: OnGrab Notifications
This commit is contained in:
@@ -4,9 +4,7 @@ using System.Linq;
|
||||
using System.Net;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using NzbDrone.Common.EnvironmentInfo;
|
||||
using NzbDrone.Common.Extensions;
|
||||
using NzbDrone.Core.Datastore;
|
||||
using NzbDrone.Core.Exceptions;
|
||||
|
||||
namespace Prowlarr.Http.Extensions
|
||||
{
|
||||
@@ -129,6 +127,16 @@ namespace Prowlarr.Http.Extensions
|
||||
return remoteIP.ToString();
|
||||
}
|
||||
|
||||
public static string GetSource(this HttpRequest request)
|
||||
{
|
||||
if (request.Headers.TryGetValue("X-Prowlarr-Client", out var source))
|
||||
{
|
||||
return "Prowlarr";
|
||||
}
|
||||
|
||||
return NzbDrone.Common.Http.UserAgentParser.ParseSource(request.Headers["User-Agent"]);
|
||||
}
|
||||
|
||||
public static string GetHostName(this HttpRequest request)
|
||||
{
|
||||
string ip = request.GetRemoteIP();
|
||||
|
||||
Reference in New Issue
Block a user