headers method
Returns headers for a response.
Implementation
@override
Map headers(SocketConnect connect, [Map? headers]) {
headers = headers ?? {};
var req = connect.request;
if (req.headers.value('origin') != null) {
headers['Access-Control-Allow-Credentials'] = 'true';
headers['Access-Control-Allow-Origin'] = req.headers.value('origin');
} else {
headers['Access-Control-Allow-Origin'] = '*';
}
return super.headers(connect, headers);
}