MCPcopy Create free account
hub / github.com/QLHazyCoder/FlowPilot / buildCloudflareTempEmailHeaders

Function buildCloudflareTempEmailHeaders

cloudflare-temp-email-utils.js:60–77  ·  view source on GitHub ↗
(config = {}, options = {})

Source from the content-addressed store, hash-verified

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);

Calls 1

firstNonEmptyStringFunction · 0.70

Tested by

no test coverage detected