mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-04 04:56:49 +00:00
Use a proper user agent when fetching images
This commit is contained in:
parent
55c56c4e58
commit
41427db178
10 changed files with 106 additions and 87 deletions
|
|
@ -5,6 +5,7 @@ using Autofac;
|
|||
|
||||
using Myriad.Cache;
|
||||
using Myriad.Gateway;
|
||||
using Myriad.Rest;
|
||||
|
||||
using NodaTime;
|
||||
|
||||
|
|
@ -113,7 +114,8 @@ namespace PluralKit.Bot
|
|||
// Utils
|
||||
builder.Register(c => new HttpClient
|
||||
{
|
||||
Timeout = TimeSpan.FromSeconds(5)
|
||||
Timeout = TimeSpan.FromSeconds(5),
|
||||
DefaultRequestHeaders = {{"User-Agent", DiscordApiClient.UserAgent}}
|
||||
}).AsSelf().SingleInstance();
|
||||
builder.RegisterInstance(SystemClock.Instance).As<IClock>();
|
||||
builder.RegisterType<SerilogGatewayEnricherFactory>().AsSelf().SingleInstance();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue