mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
Fix bug with manual download cookies
This commit is contained in:
parent
c4850217bc
commit
56c0d4eb8a
@ -14,19 +14,12 @@ namespace Wabbajack.Common.Http
|
||||
public async Task<HttpResponseMessage> GetAsync(string url, HttpCompletionOption responseHeadersRead = HttpCompletionOption.ResponseContentRead)
|
||||
{
|
||||
var request = new HttpRequestMessage(HttpMethod.Get, url);
|
||||
foreach (var (k, v) in Headers)
|
||||
request.Headers.Add(k, v);
|
||||
return await SendAsync(request, responseHeadersRead);
|
||||
}
|
||||
|
||||
public async Task<string> GetStringAsync(string url)
|
||||
{
|
||||
var request = new HttpRequestMessage(HttpMethod.Get, url);
|
||||
foreach (var (k, v) in Headers)
|
||||
request.Headers.Add(k, v);
|
||||
if (Cookies.Count > 0)
|
||||
Cookies.ForEach(c => ClientFactory.Cookies.Add(c));
|
||||
|
||||
return await SendStringAsync(request);
|
||||
}
|
||||
|
||||
@ -39,6 +32,10 @@ namespace Wabbajack.Common.Http
|
||||
|
||||
public async Task<HttpResponseMessage> SendAsync(HttpRequestMessage msg, HttpCompletionOption responseHeadersRead = HttpCompletionOption.ResponseContentRead)
|
||||
{
|
||||
foreach (var (k, v) in Headers)
|
||||
msg.Headers.Add(k, v);
|
||||
if (Cookies.Count > 0)
|
||||
Cookies.ForEach(c => ClientFactory.Cookies.Add(c));
|
||||
int retries = 0;
|
||||
TOP:
|
||||
try
|
||||
|
Loading…
Reference in New Issue
Block a user