Skip to content

Commit

Permalink
fix: more header fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Lulalaby committed Dec 16, 2024
1 parent a6ea5dc commit 10ed8bf
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion DisCatSharp.Lavalink/LavalinkSession.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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}");
Expand Down
2 changes: 2 additions & 0 deletions DisCatSharp/Clients/DiscordClient.WebSocket.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using DisCatSharp.Entities;
using DisCatSharp.Enums;
using DisCatSharp.EventArgs;
using DisCatSharp.Net;
using DisCatSharp.Net.Abstractions;
using DisCatSharp.Net.WebSocket;

Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion DisCatSharp/Entities/Guild/DiscordGuild.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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}";
}

/// <summary>
Expand Down

0 comments on commit 10ed8bf

Please sign in to comment.