UNPKG

@dasch-swiss/dsp-js

Version:
30 lines 1.15 kB
/** * @deprecated use Version endpoint instead * @category Internal */ export var HealthConversionUtil; (function (HealthConversionUtil) { /** * Adds the versions of webapi and Pekka to the health response. * Throws an error if the header information received from Knora is invalid. * * @param healthResponse the health response reveived from Knora. * @param serverHeaderParam the server header param, if any. */ HealthConversionUtil.addHeaderInfoToHealthResponse = (healthResponse, serverHeaderParam) => { if (serverHeaderParam !== null) { // e.g., "webapi/v13.0.0-rc.16 akka-http/10.1.12" const versions = serverHeaderParam.split(' '); if (versions.length === 2) { return healthResponse; } else { throw new Error(`Could not parse server header param ${serverHeaderParam}.`); } } else { throw new Error('Could not get server header param.'); } }; })(HealthConversionUtil || (HealthConversionUtil = {})); //# sourceMappingURL=health-conversion-util.js.map