Skip to content
This repository was archived by the owner on Feb 4, 2025. It is now read-only.

Conversation

@duncte123
Copy link
Contributor

Pull Request

Pull Request Checklist

Please follow the following steps before opening this PR.

PRs that do not complete the checklist will be subject to denial for
missing information.

Pull Request Information

Check and fill in the blanks for all that apply:

  • My PR fixes a bug, error, or other issue with the library's codebase.
  • My PR is for the ______ module of the JDA-Utilities library.
  • My PR creates a new module for the JDA-Utilities library: ______.

Description

Discord recently changed their domain from discordapp.com to discord.com (the cdn is still on discordapp.com) meaning that the domains used need to be updated

@duncte123
Copy link
Contributor Author

duncte123 commented Jun 3, 2020

Can someone review this asap? It has all sorts of weird behavior because it gets redirected to discord.com

Temp fix is to add an interceptor for now

private val oAuth2Client = OAuth2Client.Builder() .setClientId(config.discord.oauth.clientId) .setClientSecret(config.discord.oauth.clientSecret) .setOkHttpClient( OkHttpClient.Builder() .addInterceptor { var request = it.request() val httpUrl = request.url() if (httpUrl.host().contains("discordapp")){ val newHttpUrl = httpUrl.newBuilder() .host("discord.com") .build() request = request.newBuilder() .url(newHttpUrl) .build() } it.proceed(request) } .build() ) .build()
@jagrosh jagrosh merged commit 8c28656 into JDA-Applications:master Jun 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

2 participants