diff --git a/DisCatSharp.Lavalink/LavalinkSession.cs b/DisCatSharp.Lavalink/LavalinkSession.cs index c43fe7c3f4..a310c8042a 100644 --- a/DisCatSharp.Lavalink/LavalinkSession.cs +++ b/DisCatSharp.Lavalink/LavalinkSession.cs @@ -469,7 +469,7 @@ internal async Task EstablishConnectionAsync() this._webSocket.ExceptionThrown += this.Lavalink_WebSocket_ExceptionThrown; this._webSocket.MessageReceived += this.Lavalink_WebSocket_MessageReceived; - this._webSocket.AddDefaultHeader("Authorization", this.Config.Password); + this._webSocket.AddDefaultHeader(CommonHeaders.AUTHORIZATION, this.Config.Password); this._webSocket.AddDefaultHeader("Num-Shards", this.Discord.ShardCount.ToString(CultureInfo.InvariantCulture)); this._webSocket.AddDefaultHeader("User-Id", this.Discord.CurrentUser.Id.ToString(CultureInfo.InvariantCulture)); this._webSocket.AddDefaultHeader("Client-Name", $"DisCatSharp.Lavalink/{this.Discord.VersionString}"); diff --git a/DisCatSharp/Clients/DiscordClient.WebSocket.cs b/DisCatSharp/Clients/DiscordClient.WebSocket.cs index 406b882f97..eb2d1088bf 100644 --- a/DisCatSharp/Clients/DiscordClient.WebSocket.cs +++ b/DisCatSharp/Clients/DiscordClient.WebSocket.cs @@ -7,6 +7,7 @@ using DisCatSharp.Entities; using DisCatSharp.Enums; using DisCatSharp.EventArgs; +using DisCatSharp.Net; using DisCatSharp.Net.Abstractions; using DisCatSharp.Net.WebSocket; @@ -169,6 +170,7 @@ internal async Task InternalConnectAsync() Volatile.Write(ref this._skippedHeartbeats, 0); this.WebSocketClient = this.Configuration.WebSocketClientFactory(this.Configuration.Proxy, this.ServiceProvider); + this.WebSocketClient.AddDefaultHeader(CommonHeaders.USER_AGENT, Utilities.GetUserAgent()); this._payloadDecompressor = this.Configuration.GatewayCompressionLevel is not GatewayCompressionLevel.None ? new PayloadDecompressor(this.Configuration.GatewayCompressionLevel) : null; diff --git a/DisCatSharp/Entities/Guild/DiscordGuild.cs b/DisCatSharp/Entities/Guild/DiscordGuild.cs index 2a241e6055..c8b656975a 100644 --- a/DisCatSharp/Entities/Guild/DiscordGuild.cs +++ b/DisCatSharp/Entities/Guild/DiscordGuild.cs @@ -1984,7 +1984,7 @@ public string GetWidgetImage(WidgetType bannerType = WidgetType.Shield) WidgetType.Banner4 => "banner4", _ => "shield" }; - return $"{Endpoints.BASE_URI}{Endpoints.GUILDS}/{this.Id}{Endpoints.WIDGET_PNG}?style={param}"; + return $"{Utilities.GetApiBaseUri(this.Discord.Configuration)}{Endpoints.GUILDS}/{this.Id}{Endpoints.WIDGET_PNG}?style={param}"; } ///