]> Slayer Assistant Repositories - slayer.unlishema.org/.git/commitdiff
Added discord tag for request tracking.
authorunlishema <unlishema@jtryba.com>
Sat, 20 Sep 2025 18:16:05 +0000 (14:16 -0400)
committerunlishema <unlishema@jtryba.com>
Sat, 20 Sep 2025 18:16:05 +0000 (14:16 -0400)
dist/dev.html
dist/pages/data/version.json
src/dev.html
src/pages/data/version.json

index e8c627242562a20fa49bc8079616ccf7708d0407..b0041be12d5bddf1595af64d893d32ac0888f352 100644 (file)
             }, QUEUE_WAIT_TIME);
         }
 
-        // Function to make a request to the RuneScape wiki API with caching and throttling
+        // Function to make a request to the RuneScape wiki API with caching, throttling, Discord tag in GET, and optional headers
         async function requestBucket(query, oldschool = false) {
             const url = new URL(`https://${oldschool ? "oldschool." : ""}runescape.wiki/api.php`);
+
+            // Add your Discord tag as a GET parameter
             const params = {
                 action: 'bucket',
                 format: 'json',
                 query: query,
-                origin: '*' // Required for CORS
+                origin: window.location.origin,  // Required for CORS
+                user: 'unlishema#5238'           // Discord tag in GET
             };
             url.search = new URLSearchParams(params).toString();
 
             return enqueueRequest(async () => {
                 console.log(`Fetching fresh data: ${url}`);
 
-                const response = await fetch(url);
+                const response = await fetch(url, {
+                    headers: {
+                        'X-Discord-User': 'unlishema#5238',      // Optional metadata header
+                        'X-Website': window.location.origin,     // Optional site header
+                        'X-Environment': 'production'           // Optional environment header
+                    }
+                });
+
                 if (!response.ok) {
                     throw new Error(`HTTP error! Status: ${response.status}`);
                 }
index 9cca2ad2a0fb121edafa01db0b4bc6b23ec65bdf..a674bfd42b5f50ec76c4a0640a64d70c71f89804 100644 (file)
@@ -1,3 +1,3 @@
 {
-  "version": "0.0.34"
+  "version": "0.0.35"
 }
\ No newline at end of file
index e8c627242562a20fa49bc8079616ccf7708d0407..b0041be12d5bddf1595af64d893d32ac0888f352 100644 (file)
             }, QUEUE_WAIT_TIME);
         }
 
-        // Function to make a request to the RuneScape wiki API with caching and throttling
+        // Function to make a request to the RuneScape wiki API with caching, throttling, Discord tag in GET, and optional headers
         async function requestBucket(query, oldschool = false) {
             const url = new URL(`https://${oldschool ? "oldschool." : ""}runescape.wiki/api.php`);
+
+            // Add your Discord tag as a GET parameter
             const params = {
                 action: 'bucket',
                 format: 'json',
                 query: query,
-                origin: '*' // Required for CORS
+                origin: window.location.origin,  // Required for CORS
+                user: 'unlishema#5238'           // Discord tag in GET
             };
             url.search = new URLSearchParams(params).toString();
 
             return enqueueRequest(async () => {
                 console.log(`Fetching fresh data: ${url}`);
 
-                const response = await fetch(url);
+                const response = await fetch(url, {
+                    headers: {
+                        'X-Discord-User': 'unlishema#5238',      // Optional metadata header
+                        'X-Website': window.location.origin,     // Optional site header
+                        'X-Environment': 'production'           // Optional environment header
+                    }
+                });
+
                 if (!response.ok) {
                     throw new Error(`HTTP error! Status: ${response.status}`);
                 }
index 9cca2ad2a0fb121edafa01db0b4bc6b23ec65bdf..a674bfd42b5f50ec76c4a0640a64d70c71f89804 100644 (file)
@@ -1,3 +1,3 @@
 {
-  "version": "0.0.34"
+  "version": "0.0.35"
 }
\ No newline at end of file