MCPcopy
hub / github.com/exchangeratesapi/exchangeratesapi / wrap

Function wrap

exchangerates/utils.py:32–45  ·  view source on GitHub ↗
(*args, **kwargs)

Source from the content-addressed store, hash-verified

30 def decorator(fn):
31 @wraps(fn)
32 def wrap(*args, **kwargs):
33 response = fn(*args, **kwargs)
34 if isinstance(response, BaseHTTPResponse):
35 response.headers.update(CORS_HEADERS)
36 return response
37 elif isawaitable(response):
38
39 async def make_cors():
40 r = await response
41 r.headers.update(CORS_HEADERS)
42 return r
43
44 return make_cors()
45 return response
46
47 return wrap
48

Callers

nothing calls this directly

Calls 1

make_corsFunction · 0.85

Tested by

no test coverage detected