Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
suhaotian committed Jul 18, 2024
1 parent e3eb26f commit 651e7c3
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/interceptors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,10 @@ export default async function defaultRequestInterceptor(req: XiorInterceptorRequ
contentType = req.headers[key];
}
}
if (isUrlSearchParams) {
contentType = formUrl;
} else if (!contentType) {
contentType = isGet ? formUrl : jsonType;
if (!contentType || isUrlSearchParams) {
contentType = isGet || isUrlSearchParams ? formUrl : jsonType;
headers[contentTypeKey] = contentType;
}
headers[contentTypeKey] = contentType;

if (typeof data === 'object') {
if (isGet && req.params) {
Expand Down

0 comments on commit 651e7c3

Please sign in to comment.