You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 line
7.2 KiB
1 line
7.2 KiB
|
1 week ago
|
{"ast":null,"code":"import \"core-js/modules/web.dom-exception.stack.js\";\nimport platform from '../platform/index.js';\nimport utils from '../utils.js';\nimport isURLSameOrigin from './isURLSameOrigin.js';\nimport cookies from './cookies.js';\nimport buildFullPath from '../core/buildFullPath.js';\nimport mergeConfig from '../core/mergeConfig.js';\nimport AxiosHeaders from '../core/AxiosHeaders.js';\nimport buildURL from './buildURL.js';\nexport default (config => {\n const newConfig = mergeConfig({}, config);\n let {\n data,\n withXSRFToken,\n xsrfHeaderName,\n xsrfCookieName,\n headers,\n auth\n } = newConfig;\n newConfig.headers = headers = AxiosHeaders.from(headers);\n newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url, newConfig.allowAbsoluteUrls), config.params, config.paramsSerializer);\n\n // HTTP basic authentication\n if (auth) {\n headers.set('Authorization', 'Basic ' + btoa((auth.username || '') + ':' + (auth.password ? unescape(encodeURIComponent(auth.password)) : '')));\n }\n if (utils.isFormData(data)) {\n if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) {\n headers.setContentType(undefined); // browser handles it\n } else if (utils.isFunction(data.getHeaders)) {\n // Node.js FormData (like form-data package)\n const formHeaders = data.getHeaders();\n // Only set safe headers to avoid overwriting security headers\n const allowedHeaders = ['content-type', 'content-length'];\n Object.entries(formHeaders).forEach(([key, val]) => {\n if (allowedHeaders.includes(key.toLowerCase())) {\n headers.set(key, val);\n }\n });\n }\n }\n\n // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n\n if (platform.hasStandardBrowserEnv) {\n withXSRFToken && utils.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(newConfig));\n if (withXSRFToken || withXSRFToken !== false && isURLSameOrigin(newConfig.url)) {\n // Add xsrf header\n const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies.read(xsrfCookieName);\n if (xsrfValue) {\n headers.set(xsrfHeaderName, xsrfValue);\n }\n }\n }\n return newConfig;\n});","map":{"version":3,"names":["platform","utils","isURLSameOrigin","cookies","buildFullPath","mergeConfig","AxiosHeaders","buildURL","config","newConfig","data","withXSRFToken","xsrfHeaderName","xsrfCookieName","headers","auth","from","url","baseURL","allowAbsoluteUrls","params","paramsSerializer","set","btoa","username","password","unescape","encodeURIComponent","isFormData","hasStandardBrowserEnv","hasStandardBrowserWebWorkerEnv","setContentType","undefined","isFunction","getHeaders","formHeaders","allowedHeaders","Object","entries","forEach","key","val","includes","toLowerCase","xsrfValue","read"],"sources":["D:/Project/SISP-ADSI-601/vue/node_modules/axios/lib/helpers/resolveConfig.js"],"sourcesContent":["import platform from '../platform/index.js';\nimport utils from '../utils.js';\nimport isURLSameOrigin from './isURLSameOrigin.js';\nimport cookies from './cookies.js';\nimport buildFullPath from '../core/buildFullPath.js';\nimport mergeConfig from '../core/mergeConfig.js';\nimport AxiosHeaders from '../core/AxiosHeaders.js';\nimport buildURL from './buildURL.js';\n\nexport default (config) => {\n const newConfig = mergeConfig({}, config);\n\n let { data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth } = newConfig;\n\n newConfig.headers = headers = AxiosHeaders.from(headers);\n\n newConfig.url = buildURL(\n buildFullPath(newConfig.baseURL, newConfig.url, newConfig.allowAbsoluteUrls),\n config.params,\n config.paramsSerializer\n );\n\n // HTTP basic authentication\n if (auth) {\n headers.set(\n 'Authorization',\n 'Basic ' +\n btoa(\n (auth.username || '') +\n ':' +\n (auth.password ? unescape(encodeURIComponent(auth.password)) : '')\n )
|