Fixing an issue that type 'null' is not assignable to validateStatus …#8
Fixing an issue that type 'null' is not assignable to validateStatus …#8MitchLewis930 wants to merge 1 commit intopr_028_beforefrom
Conversation
…xios#2773) Co-authored-by: Xianming Zhong <chinesedfan@qq.com> Co-authored-by: Jay <jasonsaayman@gmail.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
| onUploadProgress?: (progressEvent: ProgressEvent) => void; | ||
| onDownloadProgress?: (progressEvent: ProgressEvent) => void; | ||
| maxContentLength?: number; | ||
| validateStatus?: ((status: number) => boolean | null); |
There was a problem hiding this comment.
Wrong parentheses placement in validateStatus type definition
High Severity
The validateStatus type has incorrect parentheses placement. The current type ((status: number) => boolean | null) defines a function returning boolean | null. However, the PR intends to fix setting validateStatus itself to null (to accept all HTTP status codes). The correct type is ((status: number) => boolean) | null, where the property can be either a function OR null. This doesn't fix the reported issue and incorrectly changes the function's return type semantics.


PR_028
Note
Low Risk
Type-only change to a single config field; runtime behavior is unchanged, with minimal risk aside from potential downstream typing expectations.
Overview
Updates TypeScript typings for
AxiosRequestConfig.validateStatusto allow the function to returnnull(i.e.,boolean | null), resolving type errors when users supply avalidateStatusimplementation that returnsnull.Written by Cursor Bugbot for commit b03f161. This will update automatically on new commits. Configure here.