def set_cors_headers(resp, options):
<EOL>if hasattr(resp, FLASK_CORS_EVALUATED):<EOL><INDENT>LOG.debug('<STR_LIT>')<EOL>return resp<EOL><DEDENT>if (not isinstance(resp.headers, Headers)<EOL>and not isinstance(resp.headers, MultiDict)):<EOL><INDENT>resp.headers = MultiDict(resp.headers)<EOL><DEDENT>headers_to_set = get_cors_headers(options, request.headers, request.method)<EOL>LOG.debug('<STR_LIT>', str(headers_to_set))<EOL>for k, v in headers_to_set.items():<EOL><INDENT>resp.headers.add(k, v)<EOL><DEDENT>return resp<EOL>
Performs the actual evaluation of Flas-CORS options and actually
modifies the response object.

This function is used both in the decorator and the after_request
callback