Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
Hazarth95193yI have to say CORS is one of the more simplest ideas in internet security. It seems to be so simple, that people outright refuse to see how simple it is and keep thinking it's actually complicated.
literally it just tells the browser if it can make request on behalf of the user to a cross-origin
so if your user is on shadybank.com trying to communicate to api.realbank.com, the request will be blocked, because the API will tell the browser "hold up, the user is on some fucking retarded site, he can't talk to use from there, something is wrong"
and it all revolves around the accept-origin and accept-headers headers. Essentially you just set your server up so it only allows users to talk to it through known origins and using known headers.
It's something you should always have configured properly for both prod and dev environment, so you don't forget to turn it on once you're done developing -
Tbh, I wish there was an easier way to disable that for development.
My backend literally has a "allow all cors" flag, so the fontend on a separate debug port can use it.
Imo, it should see different ports on localhost as same-orign. But then there are apps that use a webpanel on localhost. So I guess not.
Related Rants
-
boombodies15Manager: We need to setup the security in the Mexico server Dev: You mean that 3rd party firewall add on? Ma...
-
boombodies26Manager: Why aren’t you working? Dev: I am, I’m just not typing because I’m thinking an issue out. Man...
-
boombodies19Manager: How come the intern does way more tickets than you? Dev: Because you told me to only give him the ea...
Manager: I’m getting a strange error now….it says CORS? Any idea what that means?
Dev: Ezpz, just a matter of how many goats to sacrifice and incantations to recite
Manager: Are you serio—
Dev: Bring me my debugging pentagram
rant
garbage collection
debugging hell