Open matronator opened 4 months ago
Hi @matronator, it's a complex bug report, thank you for that. Unfortunately I think your code is OK. I need from you to setup https://github.com/contributte/apitte-skeleton/ or pack your project (remove non-required stuff) and send it to me for further inspection. What's your choice?
ping @matronator
I've been banging my head on this for couple of hours now. I just can't seem to get CORS to work correctly. No matter what I do, no CORS headers are sent, no matter the method or URI.
Can someone please tell me what I'm missing?
config.neon
(only the relevant stuff)App/Api/Middleware/CORSMiddleware.php
(I used the same as in apitte-skeleton, this version is only after trying to get it to work by trial and error)Controller.php
But I still get no additional headers added to my response and Chrome still complains:
However what I don't understand is why Chrome is complaining about no CORS headers, when the preflight check passed apparently, because the only request showing in the console is a
POST
request and notOPTIONS
.Request:
Response:
But then why is the response a 500 error, that on further inspection the code shouldn't even reach that far. The actual error is a missing property on the entity (
tokenSupply
), which is BS, because it is sent in the payload:I am thoroughly lost...
Also, WHY ARE THERE NO HEADERS IN THE RESPONSE when I am decorating everything in the CORSMiddleware?