UNPKG

cdn-cache-check

Version:

Makes HTTP requests to URLs and parses response headers to determine caching behaviour

41 lines (35 loc) 2.13 kB
function init() { global.CCC_SERVICE_DETECTION_STATUS_LABEL = { 'CDN': 'CDN', 'ERROR': 'Error', 'AWS': 'AWS', 'AZURE': 'Azure', 'OTHER': 'Other Internet Service', 'UNKNOWN': 'Unknown' }; global.CCC_DNS = { 'REQUEST_RECORD_TYPE': 'A', 'DEFAULT_RESOLVER': '8.8.8.8' }; global.CCC_REQUEST = { 'WARNING_THRESHOLD': 5 }; global.CCC_OUTPUT = { 'REDIRECT_INDICATOR': '\u00AE', 'PADDING_CHARACTER': '.' }; global.CCC_SERVICE_DETECTION_DEFAULT_RESPONSE = { fqdn: null, // The Fully Qualified Domain Name being inspected ipAddress: null, // The IP address the FQDN resolves to (*** what if it resolves to multiple addresses?) message: null, // The last message generated by Service Detection messages: [], // All the messages generated by Service Detection reason: null, // Descriptive text behind detection result shown via --verbose switch region: null, // Cloud region string hosting the service, if applicable regionId: 0, // Cloud region ID hosting the service, if applicable service: null, // Service name/title/label/identifier serviceDetected: false, // True when a service detection function has identified a service behind the domain/IP address status: global.CCC_SERVICE_DETECTION_STATUS_LABEL.UNKNOWN, // Service Detection Status. one of CCC_SERVICE_DETECTION_STATUS_LABEL }; global.CCC_DEFAULT_USERAGENT = 'ccc/1.0'; // The default user-agent string used in HTTP(S) requests } module.exports = { init };