Skip to content
Snippets Groups Projects
Commit 692619a8 authored by michael.minelli's avatar michael.minelli
Browse files

HttpManager => Accept gzip encoding

parent e791f191
No related branches found
No related tags found
No related merge requests found
Pipeline #25596 passed
......@@ -17,17 +17,20 @@ class HttpManager {
private registerRequestInterceptor() {
axios.interceptors.request.use((config) => {
if ( config.data instanceof FormData ) {
config.headers = { ...config.headers, ...(config.data as FormData).getHeaders() } as AxiosRequestHeaders;
}
if ( config.url && (config.url.indexOf(ClientsSharedConfig.apiURL) !== -1) ) {
config.headers['Accept-Encoding'] = 'gzip';
if ( config.data && Object.keys(config.data).length > 0 ) {
config.headers['Content-Type'] = 'multipart/form-data';
}
if ( SessionManager.isLogged ) {
config.headers.Authorization = 'Bearer ' + SessionManager.token;
config.headers.Authorization = `Bearer ${ SessionManager.token }`;
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment