mirror of
https://github.com/imputnet/cobalt.git
synced 2026-08-01 07:04:17 -05:00
[GH-ISSUE #98] Unable to fetch() from API due to CORS policy.
#15650
Reference in New Issue
Block a user
Originally created by @jojobii-arks on GitHub (Mar 28, 2023).
Original GitHub issue: https://github.com/imputnet/cobalt/issues/98
Issue
Access-Control-Allow-Originheader isn't present on preflight response, resulting in the fetch being rejected.{cors: 'no-cors'}withinfetchoptions param since it just reverts thecontent-typeback toplain/text, resulting in an incorrect ContentType for the JSON middleware used here: https://github.com/wukko/cobalt/blob/adba73d60c43c4358dd4f71c65070c185773064a/src/cobalt.js#L70Possible Solution
Access-Control-Allow-Originto*to allow for CORS. I did this on my fork if you wanna take a lookie .3. https://github.com/jojobii-arks/cobalt-epic-style/commit/3972535eff5bbe0cfe677334c7e9d15afa83eae6@kotobdev commented on GitHub (Mar 28, 2023):
I ran across the same issue when making my own extension, I "solved" it by changing my nginx config a bit- but having an actual fix would be nice :)
@ReznorsRevenge1 commented on GitHub (Jul 11, 2024):
Uhh, I'm still having this exact problem.
@dumbmoron commented on GitHub (Jul 11, 2024):
are you having this problem on your own instance, or on the main instance (api.cobalt.tools)?
@ihatespawn commented on GitHub (Jul 11, 2024):
why are people commenting on a 1 year old issue
can't you just open a new one?
@ReznorsRevenge1 commented on GitHub (Jul 12, 2024):
The api.cobalt.tools
@ReznorsRevenge1 commented on GitHub (Jul 12, 2024):
Why should I, if there is already an issue describing the exact problem I'm having?
@ihatespawn commented on GitHub (Jul 12, 2024):
it was resolved a year ago, there is a better chance of someone helping you with that (i have notifications for cobalt but not everyone that could help you has them) and most of the people don't like necroposting. oh, and it also makes it less confusing for people like me.
oh, and also there are templates that ask you for information to make helping faster.
you don't have the exactly same issue. this issue is about the access-control-allow-origin header not being set to '*' and it's now fixed

yours is different and you didn't even provide any information or code
so, you should just create a new issue, here's the template for that: https://github.com/imputnet/cobalt/issues/new?assignees=&labels=main+instance+issue&projects=&template=bug-main-instance.md&title=%5Bshort+description+of+the+bug%5D