Skip to content

Comments

Fixing an issue that type 'null' is not assignable to validateStatus …#8

Open
MitchLewis930 wants to merge 1 commit intopr_028_beforefrom
pr_028_after
Open

Fixing an issue that type 'null' is not assignable to validateStatus …#8
MitchLewis930 wants to merge 1 commit intopr_028_beforefrom
pr_028_after

Conversation

@MitchLewis930
Copy link

@MitchLewis930 MitchLewis930 commented Jan 30, 2026

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.validateStatus to allow the function to return null (i.e., boolean | null), resolving type errors when users supply a validateStatus implementation that returns null.

Written by Cursor Bugbot for commit b03f161. This will update automatically on new commits. Configure here.

…xios#2773)

Co-authored-by: Xianming Zhong <chinesedfan@qq.com>
Co-authored-by: Jay <jasonsaayman@gmail.com>
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Fix in Cursor Fix in Web

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants