| 1 |
|
| MODULE = Punk PACKAGE = Punk::CORS |
| 2 |
|
| |
| 3 |
|
| PROTOTYPES: DISABLE |
| 4 |
|
| |
| 5 |
|
| # The one piece of the CORS path that cannot be C: a nonblocking handler hands |
| 6 |
|
| # back a Future, and chaining onto it needs ->then. Punk::CORS::_chain does the |
| 7 |
|
| # chaining and calls this to do the work (punk_cors.h). Everything else - |
| 8 |
|
| # preflight and the triplet and streaming shapes - happens in pc_app_cb without |
| 9 |
|
| # a Perl frame. |
| 10 |
|
| void |
| 11 |
|
| _decorate(resp, cfg, allow) |
| 12 |
|
| SV *resp |
| 13 |
|
| SV *cfg |
| 14 |
|
| SV *allow |
| 15 |
|
| CODE: |
| 16 |
|
| { |
| 17 |
2 |
| AV *headers = pco_headers_of(aTHX_ resp); |
| 18 |
2 |
▶ | if (headers && cfg && SvROK(cfg) && SvTYPE(SvRV(cfg)) == SVt_PVHV) |
Branch: 4 branches
| Branch | True | False | Total |
| if (headers && cfg && SvROK(cfg) && SvTYPE(SvRV(cfg)) == SVt_PVHV) |
2 |
0 |
2 |
| if (headers && cfg && SvROK(cfg) && SvTYPE(SvRV(cfg)) == SVt_PVHV) |
2 |
0 |
2 |
| if (headers && cfg && SvROK(cfg) && SvTYPE(SvRV(cfg)) == SVt_PVHV) |
2 |
0 |
2 |
| if (headers && cfg && SvROK(cfg) && SvTYPE(SvRV(cfg)) == SVt_PVHV) |
2 |
0 |
2 |
|
| 19 |
2 |
| pco_add(aTHX_ headers, (HV *)SvRV(cfg), allow); |
| 20 |
|
| } |