@classmethod<EOL><INDENT>def decorate_route_crossdomain(cls, origin=None, methods=None, headers=None):<DEDENT>
if methods is not None and not isinstance(methods, basestring):<EOL><INDENT>methods = '<STR_LIT:U+002CU+0020>'.join(sorted(x.upper() for x in methods))<EOL><DEDENT>if headers is not None and not isinstance(headers, basestring):<EOL><INDENT>headers = '<STR_LIT:U+002CU+0020>'.join(x.upper() for x in headers)<EOL><DEDENT>if not isinstance(origin, basestring):<EOL><INDENT>origin = '<STR_LIT:U+002CU+0020>'.join(origin)<EOL><DEDENT>def get_methods():<EOL><INDENT>if methods is not None:<EOL><INDENT>return methods<EOL><DEDENT>options_resp = current_app.make_default_options_response()<EOL>return options_resp.headers['<STR_LIT>']<EOL><DEDENT>def decorator(f):<EOL><INDENT>def wrapped_function(*args, **kwargs):<EOL><INDENT>if request.method == '<STR_LIT>':<EOL><INDENT>resp = current_app.make_default_options_response()<EOL><DEDENT>else:<EOL><INDENT>resp = make_response(f(*args, **kwargs))<EOL><DEDENT>h = resp.headers<EOL>h['<STR_LIT>'] = origin<EOL>h['<STR_LIT>'] = get_methods()<EOL>if headers is not None:<EOL><INDENT>h['<STR_LIT>'] = headers<EOL><DEDENT>return resp<EOL><DEDENT>return update_wrapper(wrapped_function, f)<EOL><DEDENT>return decorator<EOL>
route decorator that allows for configuration of access control allow
headers

Keyword arguments:

    - origin (str, list): allowed origin hosts
    - methods (str, list): allowed origin methods
    - headers (str, list): allowed origin headers

Example config:

    routes:
      /page:
        target: my_app->target
        crossdomain:
          origin: '*'