Skip to content

Commit 10ca982

Browse files
committed
fix: prevent axios from sending invalid content-length headers
1 parent cb1f3a7 commit 10ca982

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

frontend/src/composables/useApi.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ function request<T>(url: string, method: AxiosRequestConfig["method"], data: obj
1010
.request<T>({
1111
method,
1212
url: `/api/${url}`,
13-
data: method?.toLowerCase() === "get" ? {} : data,
14-
params: method?.toLowerCase() === "get" ? data : {},
13+
data: method?.toLowerCase() === "get" ? undefined : data,
14+
params: method?.toLowerCase() === "get" ? data : undefined,
1515
...axiosOptions,
1616
paramsSerializer: (params) => {
1717
return qs.stringify(params, {

0 commit comments

Comments
 (0)