Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ export interface AxiosRequestConfig {
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

maxBodyLength?: number;
validateStatus?: (status: number) => boolean;
maxRedirects?: number;
socketPath?: string | null;
httpAgent?: any;
Expand Down