format, add comments
This commit is contained in:
parent
fbe42927df
commit
16717567b7
@ -58,7 +58,10 @@ export function createAiScriptEnv(opts) {
|
|||||||
});
|
});
|
||||||
init.headers = typedHeaders;
|
init.headers = typedHeaders;
|
||||||
}
|
}
|
||||||
|
|
||||||
const response = await fetch(url.value, init);
|
const response = await fetch(url.value, init);
|
||||||
|
|
||||||
|
// Parsing Section
|
||||||
const contentType = response.headers.get('Content-Type');
|
const contentType = response.headers.get('Content-Type');
|
||||||
if (contentType === null) {
|
if (contentType === null) {
|
||||||
return utils.jsToVal(await response.text());
|
return utils.jsToVal(await response.text());
|
||||||
@ -70,6 +73,7 @@ export function createAiScriptEnv(opts) {
|
|||||||
const parser = new DOMParser();
|
const parser = new DOMParser();
|
||||||
return utils.jsToVal(parser.parseFromString((await response.text()), 'application/xml'));
|
return utils.jsToVal(parser.parseFromString((await response.text()), 'application/xml'));
|
||||||
}
|
}
|
||||||
|
// Content-Type不明
|
||||||
return utils.jsToVal(await response.text());
|
return utils.jsToVal(await response.text());
|
||||||
}),
|
}),
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user