Spaces:
Runtime error
Runtime error
Update network_fix.js
Browse files- network_fix.js +2 -1
network_fix.js
CHANGED
|
@@ -48,7 +48,8 @@ function applyAdvancedFixes() {
|
|
| 48 |
globalObj.fetch = async function(input, init) {
|
| 49 |
let urlStr = typeof input === 'string' ? input : (input.url || input.toString());
|
| 50 |
if (urlStr.includes('discord')) {
|
| 51 |
-
|
|
|
|
| 52 |
}
|
| 53 |
let newInit = { ...(init || {}) };
|
| 54 |
if (!newInit.headers) newInit.headers = {};
|
|
|
|
| 48 |
globalObj.fetch = async function(input, init) {
|
| 49 |
let urlStr = typeof input === 'string' ? input : (input.url || input.toString());
|
| 50 |
if (urlStr.includes('discord')) {
|
| 51 |
+
// Use a more precise regex to only replace the domain part
|
| 52 |
+
urlStr = urlStr.replace(/\b(discord\.com|discordapp\.com|ptb\.discord\.com|canary\.discord\.com|dis\.gd|discord\.gg)\b/, target_domain);
|
| 53 |
}
|
| 54 |
let newInit = { ...(init || {}) };
|
| 55 |
if (!newInit.headers) newInit.headers = {};
|