mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-14 09:03:49 -07:00
Fixed: uTorrent api proxy would fail on specific Win10 configurations. (The Phoenix Rises)
Moved token queryparam to start since uTorrent requires it. Fixed handling response missing an expected Set-Cookie header. Force Cache-Control: no-cache for uTorrent. Added Connection: KeepAlive to fix inexplicable uTorrent api failure.
This commit is contained in:
parent
edea488dbe
commit
e1ea17cabf
5 changed files with 35 additions and 6 deletions
|
@ -20,6 +20,7 @@ namespace NzbDrone.Common.Http
|
|||
public HttpHeader Headers { get; private set; }
|
||||
public bool SuppressHttpError { get; set; }
|
||||
public bool AllowAutoRedirect { get; set; }
|
||||
public bool ConnectionKeepAlive { get; set; }
|
||||
public NetworkCredential NetworkCredential { get; set; }
|
||||
public Dictionary<string, string> Cookies { get; private set; }
|
||||
public List<HttpFormData> FormData { get; private set; }
|
||||
|
@ -98,6 +99,7 @@ namespace NzbDrone.Common.Http
|
|||
request.Method = Method;
|
||||
request.SuppressHttpError = SuppressHttpError;
|
||||
request.AllowAutoRedirect = AllowAutoRedirect;
|
||||
request.ConnectionKeepAlive = ConnectionKeepAlive;
|
||||
|
||||
if (NetworkCredential != null)
|
||||
{
|
||||
|
@ -232,6 +234,13 @@ namespace NzbDrone.Common.Http
|
|||
return this;
|
||||
}
|
||||
|
||||
public virtual HttpRequestBuilder KeepAlive(bool keepAlive = true)
|
||||
{
|
||||
ConnectionKeepAlive = keepAlive;
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
public virtual HttpRequestBuilder Post()
|
||||
{
|
||||
Method = HttpMethod.POST;
|
||||
|
@ -253,6 +262,19 @@ namespace NzbDrone.Common.Http
|
|||
return this;
|
||||
}
|
||||
|
||||
public virtual HttpRequestBuilder AddPrefixQueryParam(string key, object value, bool replace = false)
|
||||
{
|
||||
if (replace)
|
||||
{
|
||||
QueryParams.RemoveAll(v => v.Key == key);
|
||||
SuffixQueryParams.RemoveAll(v => v.Key == key);
|
||||
}
|
||||
|
||||
QueryParams.Insert(0, new KeyValuePair<string, string>(key, value.ToString()));
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
public virtual HttpRequestBuilder AddQueryParam(string key, object value, bool replace = false)
|
||||
{
|
||||
if (replace)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue