rxdb-server
Version:
RxDB Server Plugin
23 lines (21 loc) • 733 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.customFetchWithFixedHeaders = customFetchWithFixedHeaders;
// TODO this will be exported from the latest RxDB version on the next release
// use that instead.
function customFetchWithFixedHeaders(headers) {
function customFetch(url, options = {}) {
// Ensure options object exists and headers property is initialized
options.headers = {
...headers,
// include default custom headers
...(options.headers || {}) // merge any headers passed in the function call
};
// Call the original fetch with the modified options
return fetch(url, options);
}
return customFetch;
}
//# sourceMappingURL=utils.js.map