mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-04-11 11:46:50 +02:00
Compare commits
6 Commits
main
...
worktree-f
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d2a3f7a669 | ||
|
|
356b8ea0d6 | ||
|
|
f283b02cfe | ||
|
|
df089e6f00 | ||
|
|
0979398215 | ||
|
|
85260ab49a |
@@ -226,8 +226,10 @@ async fn build_body(
|
|||||||
|
|
||||||
let (body, content_type) = match body_type.as_str() {
|
let (body, content_type) = match body_type.as_str() {
|
||||||
"binary" => (build_binary_body(&body).await?, None),
|
"binary" => (build_binary_body(&body).await?, None),
|
||||||
"graphql" => (build_graphql_body(&method, &body), None),
|
"graphql" => (build_graphql_body(&method, &body), Some("application/json".to_string())),
|
||||||
"application/x-www-form-urlencoded" => (build_form_body(&body), None),
|
"application/x-www-form-urlencoded" => {
|
||||||
|
(build_form_body(&body), Some("application/x-www-form-urlencoded".to_string()))
|
||||||
|
}
|
||||||
"multipart/form-data" => build_multipart_body(&body, &headers).await?,
|
"multipart/form-data" => build_multipart_body(&body, &headers).await?,
|
||||||
_ if body.contains_key("text") => (build_text_body(&body, body_type), None),
|
_ if body.contains_key("text") => (build_text_body(&body, body_type), None),
|
||||||
t => {
|
t => {
|
||||||
|
|||||||
@@ -144,9 +144,10 @@ export function duplicateModel<M extends AnyModel["model"], T extends ExtractMod
|
|||||||
throw new Error("Failed to duplicate null model");
|
throw new Error("Failed to duplicate null model");
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the model has a name, try to duplicate it with a name that doesn't conflict
|
// If the model has an explicit (non-empty) name, try to duplicate it with a name that doesn't conflict.
|
||||||
let name = "name" in model ? resolvedModelName(model) : undefined;
|
// When the name is empty, keep it empty so the display falls back to the URL.
|
||||||
if (name != null) {
|
let name = "name" in model ? model.name : undefined;
|
||||||
|
if (name) {
|
||||||
const existingModels = listModels(model.model);
|
const existingModels = listModels(model.model);
|
||||||
for (let i = 0; i < 100; i++) {
|
for (let i = 0; i < 100; i++) {
|
||||||
const hasConflict = existingModels.some((m) => {
|
const hasConflict = existingModels.some((m) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user