(config = {}, options = {})
| 58 | } |
| 59 | |
| 60 | function buildCloudflareTempEmailHeaders(config = {}, options = {}) { |
| 61 | const headers = {}; |
| 62 | const adminAuth = firstNonEmptyString([config.adminAuth, config.cloudflareTempEmailAdminAuth]); |
| 63 | const customAuth = firstNonEmptyString([config.customAuth, config.cloudflareTempEmailCustomAuth]); |
| 64 | if (adminAuth) { |
| 65 | headers['x-admin-auth'] = adminAuth; |
| 66 | } |
| 67 | if (customAuth) { |
| 68 | headers['x-custom-auth'] = customAuth; |
| 69 | } |
| 70 | if (options.json) { |
| 71 | headers['Content-Type'] = 'application/json'; |
| 72 | } |
| 73 | if (options.acceptJson !== false) { |
| 74 | headers.Accept = 'application/json'; |
| 75 | } |
| 76 | return headers; |
| 77 | } |
| 78 | |
| 79 | function joinCloudflareTempEmailUrl(baseUrl, path) { |
| 80 | const normalizedBase = normalizeCloudflareTempEmailBaseUrl(baseUrl); |
no test coverage detected