You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
Thanks for writing in. It looks like I made it so that response->extraHeaders has to contain its own \r\n at the end of each header. This is not documented nor easy to discover. For this case try adding a \r\n like this:
I think I need to add a "Access-Control-Allow-Origin: *" header to my response.
I could not see how to add headers.
When I tried it here:
struct Response* responseAllocWithFile(const char* filename, const char* MIMETypeOrNULL) {
struct Response* response = responseAlloc(200, "OK", MIMETypeOrNULL, 0);
response->extraHeaders = strdup("Access-Control-Allow-Origin: *");
response->filenameToSend = strdup(filename);
return response;
}
I broke an already working (in browser with security disabled) json file response.
I really do not understand CORS that much and why when I have a server, the origins do not match. Maybe its a windows thing.
The text was updated successfully, but these errors were encountered: