(str)
| 67 | } |
| 68 | |
| 69 | function parseCookie(str) { |
| 70 | if (!str || typeof str !== 'string') { |
| 71 | return str; |
| 72 | } |
| 73 | if (str.split(';')[0]) { |
| 74 | let c = str.split(';')[0].split('='); |
| 75 | return { name: c[0], value: c[1] || '' }; |
| 76 | } |
| 77 | return null; |
| 78 | } |
| 79 | |
| 80 | function handleCorsRequest(ctx) { |
| 81 | let header = ctx.request.header; |