fix: add missing OPTIONS header support, extract shared method list, fix zh docs#11022
fix: add missing OPTIONS header support, extract shared method list, fix zh docs#11022Mohammad-Faiz-Cloud-Engineer wants to merge 6 commits into
Conversation
…utMessage typo in mergeConfig
The OPTIONS HTTP method had a runtime alias (Axios.prototype.options) and a TypeScript type declaration (HeadersDefaults.options) but was missing from the header defaults initialization and the header flattening loop. This caused per-method default headers set via axios.defaults.headers.options to be silently dropped during request dispatch, inconsistent with every other HTTP method. - lib/core/Axios.js: add 'options' to the method header delete list - lib/defaults/index.js: add 'options' to per-method header init
|
Warning Review the following alerts detected in dependencies. According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.
|
There was a problem hiding this comment.
3 issues found across 14 files
Confidence score: 3/5
docs/zh/index.mdhas malformed VitePress frontmatter (content before the block, invalid YAML comment style, and de-indentedfeatures), which can break metadata parsing and cause the page to render incorrectly or fail doc builds — fix the frontmatter structure and YAML formatting before merging.lib/defaults/index.jsduplicates the method list fromlib/core/Axios.js:153, and this has already led to anoptionsomission regression; merging as-is keeps a silent drift path for future behavior mismatches — extract the method list to a shared constant and reference it from both places.docs/zh/pages/misc/sponsors.mdnow has both a Markdown#heading and an in-template<h1>, which produces two top-level headings and can hurt document structure/accessibility — keep only one H1 source before merging.
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
… duplicate heading

Added 'options' to the per-method header init and flattening loops so it works like every other HTTP method. Also extracted the shared method list into lib/core/methodList.js so these two lists can't drift apart again.
Fixed a typo in mergeConfig timeoutMessage → timeoutErrorMessage which was silently dropping the option.
Replaced three raw TypeError throws in the Node adapter with proper AxiosError(ERR_BAD_OPTION_VALUE).
Fixed malformed VitePress frontmatter in docs/zh/index.md (heading before the block, HTML comment inside YAML, de-indented features list) and removed a duplicate from docs/zh/pages/misc/sponsors.md.
Lockfile regenerated from npm install.
Summary
Commit 856621f — Docs formatting
Commit 261b5d9 — Lockfile
Commit 5e62a1e — TypeError + timeoutMessage
Commit aa1af4f — OPTIONS method
Commit c7b259e — Shared methodList + zh docs fix