Skip to content

Commit 99f4f0e

Browse files
author
randommodder
committed
Only use alternative domain, when needed ( in web)
1 parent ef55091 commit 99f4f0e

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

lib/src/api_options.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import 'package:nyxx/src/builders/presence.dart';
22
import 'package:nyxx/src/intents.dart';
33
import 'package:nyxx/src/utils/flags.dart';
44
import 'package:oauth2/oauth2.dart';
5+
import 'package:universal_platform/universal_platform.dart';
56

67
/// Options for connecting to the Discord API.
78
abstract class ApiOptions {
@@ -17,7 +18,7 @@ abstract class ApiOptions {
1718
/// The host at which the API can be found.
1819
///
1920
/// This is always `discord.com`.
20-
String get host => 'cors.discordworker-cfb.workers.dev';//'discord.com';
21+
String get host => UniversalPlatform.isWeb ? 'cors2.discordworker-cfb.workers.dev' : "discord.com";//'discord.com'; cors.discordworker-cfb.workers.dev
2122

2223
/// The base URI relative to the [host] where the API can be found.
2324
String get baseUri => '/api/v$apiVersion';

pubspec.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ dependencies:
1818
runtime_type: ^1.0.1
1919
meta: ^1.9.1
2020
oauth2: ^2.0.2
21+
universal_platform: ^1.1.0
2122

2223
dev_dependencies:
2324
test: ^1.22.0

0 commit comments

Comments
 (0)