std1.0.0-beta-7 SafeC docs

std :: http::cors

Function std::cors_apply_headers

#include <std/http/cors.h> source · definition

void cors_apply_headers(&HttpResponse resp, const &char allowedOrigin)

Adds 'Access-Control-Allow-Origin: <allowedOrigin>' (and '...-Credentials: true' when 'allowedOrigin' isn't "*") to 'resp's headers — call on every response (not just preflights) so the browser accepts the actual response, not just the preflight.