applyCORSHeadersIfNecessary method Null safety
Implementation
void applyCORSHeadersIfNecessary(Request req, Response resp) {
if (req.isCORSRequest && !req.isPreflightRequest) {
final lastPolicyController = _lastController;
final p = lastPolicyController.policy;
if (p != null) {
if (p.isRequestOriginAllowed(req.raw)) {
resp.headers.addAll(p.headersForRequest(req));
}
}
}
}