Edit history

Earlier versions of Cannot send webhooks to Fluxer via client-side JS, newest first.

Current version | Edited by Rex
Changes
Learn more leads to docs page I linked in summaryRemoved: ### ChecksRemoved: Removed: - ☑ I searched for existing issues and didn't find a duplicate.Removed:
Show

Cannot send webhooks to Fluxer via client-side JS

Summary

I have my own static web app that uses client-side JavaScript to send messages via webhooks. It supports Discord, and I wanted to see if it could also support Fluxer, but I get CORS-related errors when trying to send anything to Fluxer. I assume it's related to how Fluxer seemingly doesn't add CORS Access-Control-Allow-Origin header in webhook responses, and Discord seemingly does, see https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/CORS/Errors/CORSMissingAllowOrigin?utm_source=devtools&utm_medium=firefox-cors-errors&utm_campaign=default

Steps to reproduce

  1. Add a webhook in a Fluxer channel
  2. Go to any webpage
  3. Open browser console
  4. Paste and run this minimal example (replacing webhook url)
    var webhookUrl = 'https://api.fluxer.app/webhooks/ID_HERE/KEY_HERE'; // Replace with your webhook URL
    
    var payload = {
      content: 'Hello from browser console!',
      username: 'Console Tester',
      embeds: [
        {
          title: 'Test Embed',
          description: 'This is a simple test message.'
        }
      ]
    };
    
    fetch(webhookUrl, {
      method: 'POST',
      headers: { 'Content-Type': 'application/json' },
      body: JSON.stringify(payload)
    })
  5. Get an error
  6. (Optional) refresh the page, replace with discord webhook link, and run again

Environment (optional)

Browser: Mozilla Firefox

Logs or screenshots (optional)

image Learn more leads to docs page I linked in summary
Original by Rex
Show

Cannot send webhooks to Fluxer via client-side JS

Summary

I have my own static web app that uses client-side JavaScript to send messages via webhooks. It supports Discord, and I wanted to see if it could also support Fluxer, but I get CORS-related errors when trying to send anything to Fluxer. I assume it's related to how Fluxer seemingly doesn't add CORS Access-Control-Allow-Origin header in webhook responses, and Discord seemingly does, see https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/CORS/Errors/CORSMissingAllowOrigin?utm_source=devtools&utm_medium=firefox-cors-errors&utm_campaign=default

Steps to reproduce

  1. Add a webhook in a Fluxer channel
  2. Go to any webpage
  3. Open browser console
  4. Paste and run this minimal example (replacing webhook url)
    var webhookUrl = 'https://api.fluxer.app/webhooks/ID_HERE/KEY_HERE'; // Replace with your webhook URL
    
    var payload = {
      content: 'Hello from browser console!',
      username: 'Console Tester',
      embeds: [
        {
          title: 'Test Embed',
          description: 'This is a simple test message.'
        }
      ]
    };
    
    fetch(webhookUrl, {
      method: 'POST',
      headers: { 'Content-Type': 'application/json' },
      body: JSON.stringify(payload)
    })
  5. Get an error
  6. (Optional) refresh the page, replace with discord webhook link, and run again

Environment (optional)

Browser: Mozilla Firefox

Logs or screenshots (optional)

image Learn more leads to docs page I linked in summary

Checks

  • ☑ I searched for existing issues and didn't find a duplicate.