Skip to content

Commit

Permalink
Fix rare segfault on doDiscordReq
Browse files Browse the repository at this point in the history
  • Loading branch information
germanoeich committed May 27, 2022
1 parent 26c626c commit 39ce2b0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/discord.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,11 +206,11 @@ func GetBotUser(token string) (*BotUserResponse, error) {

func doDiscordReq(ctx context.Context, path string, method string, body io.ReadCloser, header http.Header, query string) (*http.Response, error) {
discordReq, err := http.NewRequestWithContext(ctx, method, "https://discord.com" + path + "?" + query, body)
discordReq.Header = header
if err != nil {
return nil, err
}

discordReq.Header = header
startTime := time.Now()
discordResp, err := client.Do(discordReq)

Expand Down

0 comments on commit 39ce2b0

Please sign in to comment.