@kafkajs/confluent-schema-registry
Version:
ConfluentSchemaRegistry is a library that makes it easier to interact with the Confluent schema registry, it provides convenient methods to encode, decode and register new schemas using the Apache Avro serialization format.
18 lines • 658 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const constants_1 = require("../../constants");
const product = '@kafkajs/confluent-schema-registry';
const userAgentMiddleware = ({ clientId }) => {
const comment = clientId !== constants_1.DEFAULT_API_CLIENT_ID ? clientId : undefined;
const userAgent = comment ? `${product} (${comment})` : product;
const headers = {
'User-Agent': userAgent,
};
return {
prepareRequest: next => {
return next().then(req => req.enhance({ headers }));
},
};
};
exports.default = userAgentMiddleware;
//# sourceMappingURL=userAgent.js.map