fix: transposed Accept/Content-Type headers in server function requests (closes #4240)

This commit is contained in:
Greg Johnston
2025-08-22 16:32:42 -04:00
parent ceb7dd8ae5
commit a394eb211f
4 changed files with 8 additions and 8 deletions

View File

@@ -30,8 +30,8 @@ where
})?;
Request::try_new_patch_bytes(
path,
accepts,
Encoding::CONTENT_TYPE,
accepts,
data,
)
}

View File

@@ -28,7 +28,7 @@ where
let data = Encoding::encode(&self).map_err(|e| {
ServerFnErrorErr::Serialization(e.to_string()).into_app_error()
})?;
Request::try_new_post_bytes(path, accepts, Encoding::CONTENT_TYPE, data)
Request::try_new_post_bytes(path, Encoding::CONTENT_TYPE, accepts, data)
}
}

View File

@@ -28,7 +28,7 @@ where
let data = Encoding::encode(&self).map_err(|e| {
ServerFnErrorErr::Serialization(e.to_string()).into_app_error()
})?;
Request::try_new_put_bytes(path, accepts, Encoding::CONTENT_TYPE, data)
Request::try_new_put_bytes(path, Encoding::CONTENT_TYPE, accepts, data)
}
}

View File

@@ -46,7 +46,7 @@ where
let data = serde_qs::to_string(&self).map_err(|e| {
ServerFnErrorErr::Serialization(e.to_string()).into_app_error()
})?;
Request::try_new_get(path, accepts, GetUrl::CONTENT_TYPE, &data)
Request::try_new_get(path, GetUrl::CONTENT_TYPE, accepts, &data)
}
}
@@ -85,7 +85,7 @@ where
let qs = serde_qs::to_string(&self).map_err(|e| {
ServerFnErrorErr::Serialization(e.to_string()).into_app_error()
})?;
Request::try_new_post(path, accepts, PostUrl::CONTENT_TYPE, qs)
Request::try_new_post(path, PostUrl::CONTENT_TYPE, accepts, qs)
}
}
@@ -124,7 +124,7 @@ where
let data = serde_qs::to_string(&self).map_err(|e| {
ServerFnErrorErr::Serialization(e.to_string()).into_app_error()
})?;
Request::try_new_delete(path, accepts, GetUrl::CONTENT_TYPE, &data)
Request::try_new_delete(path, DeleteUrl::CONTENT_TYPE, accepts, &data)
}
}
@@ -163,7 +163,7 @@ where
let data = serde_qs::to_string(&self).map_err(|e| {
ServerFnErrorErr::Serialization(e.to_string()).into_app_error()
})?;
Request::try_new_patch(path, accepts, GetUrl::CONTENT_TYPE, data)
Request::try_new_patch(path, PatchUrl::CONTENT_TYPE, accepts, data)
}
}
@@ -202,7 +202,7 @@ where
let data = serde_qs::to_string(&self).map_err(|e| {
ServerFnErrorErr::Serialization(e.to_string()).into_app_error()
})?;
Request::try_new_put(path, accepts, GetUrl::CONTENT_TYPE, data)
Request::try_new_put(path, PutUrl::CONTENT_TYPE, accepts, data)
}
}