gitlab-org--gitlab-foss/spec/javascripts/helpers/vue_resource_helper.js

12 lines
331 B
JavaScript
Raw Normal View History

2017-07-12 10:47:09 -04:00
// eslint-disable-next-line import/prefer-default-export
export const headersInterceptor = (request, next) => {
2018-10-17 03:13:26 -04:00
next(response => {
2017-07-12 10:47:09 -04:00
const headers = {};
response.headers.forEach((value, key) => {
headers[key] = value;
});
// eslint-disable-next-line no-param-reassign
2017-07-12 10:47:09 -04:00
response.headers = headers;
});
};