axios merge headers from config
- Dominant language
- Vue
- Stars
- 16.4k
- Forks
- 4.7k
- PR merge metrics
- No merged PRs in 30d
Description
在 libs/axios.js 文件中,封装的axios,不能对headers 合并,现贴上 request 函数的代码
`
request (options) {
const instance = axios.create()
const insideConfig = this.getInsideConfig()
if (options.headers) {
insideConfig.headers = Object.assign(insideConfig.headers, options.headers)
delete options.headers
}
options = Object.assign(insideConfig, options)
this.interceptors(instance, options.url)
return instance(options)
}
`
, 合并下 options 参数里的 headers 与 getInsideConfig() 方法返回的 headers
Contributor guide
No contributing guide indexed for this repository
Research direction
Read libs/axios.js, focusing on request(options) and getInsideConfig(). Reproduce the request with headers in options, verify they are combined with the headers returned by getInsideConfig(), and confirm the resulting axios request preserves both sets of headers.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- api
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100