Update proxy credentials logic
This commit is contained in:
parent
f00b602e71
commit
c77168b393
1 changed files with 3 additions and 2 deletions
|
@ -29,8 +29,9 @@ namespace Server.Services.Implementations {
|
||||||
|
|
||||||
HttpClientHandler httpClientHandler = new() {
|
HttpClientHandler httpClientHandler = new() {
|
||||||
UseProxy = proxySettings.Value.UseProxy,
|
UseProxy = proxySettings.Value.UseProxy,
|
||||||
Proxy = proxySettings.Value.UseProxy ? new WebProxy(proxySettings.Value.Url) : null,
|
Proxy = proxySettings.Value.UseProxy ? new WebProxy(proxySettings.Value.Url) {
|
||||||
DefaultProxyCredentials = string.IsNullOrEmpty(proxySettings.Value.Credentials?.Username) ? null : new NetworkCredential(proxySettings.Value.Credentials.Username, proxySettings.Value.Credentials.Password),
|
Credentials = string.IsNullOrEmpty(proxySettings.Value.Credentials?.Username) ? null : new NetworkCredential(proxySettings.Value.Credentials.Username, proxySettings.Value.Credentials.Password),
|
||||||
|
} : null,
|
||||||
};
|
};
|
||||||
InfoferScraper.Scrapers.StationScraper stationScraper = new(httpClientHandler);
|
InfoferScraper.Scrapers.StationScraper stationScraper = new(httpClientHandler);
|
||||||
InfoferScraper.Scrapers.TrainScraper trainScraper = new(httpClientHandler);
|
InfoferScraper.Scrapers.TrainScraper trainScraper = new(httpClientHandler);
|
||||||
|
|
Loading…
Add table
Reference in a new issue