mirror of
https://github.com/prymitive/karma
synced 2026-05-09 03:36:44 +00:00
fix(ui): revert use mode:no-cors for fetch GET requests
responses for mode:no-cors requests have no body, which we need
This commit is contained in:
@@ -6,18 +6,7 @@ const CommonOptions = {
|
||||
};
|
||||
|
||||
const FetchGet = async (uri, options) =>
|
||||
await fetch(
|
||||
uri,
|
||||
merge(
|
||||
{},
|
||||
{
|
||||
method: "GET",
|
||||
mode: "no-cors"
|
||||
},
|
||||
CommonOptions,
|
||||
options
|
||||
)
|
||||
);
|
||||
await fetch(uri, merge({}, { method: "GET" }, CommonOptions, options));
|
||||
|
||||
const FetchPost = async (uri, options) =>
|
||||
await fetch(uri, merge({}, { method: "POST" }, CommonOptions, options));
|
||||
|
||||
@@ -18,7 +18,7 @@ describe("Fetch", () => {
|
||||
};
|
||||
|
||||
const methodOptions = {
|
||||
FetchGet: { method: "GET", mode: "no-cors" },
|
||||
FetchGet: { method: "GET" },
|
||||
FetchPost: { method: "POST" },
|
||||
FetchDelete: { method: "DELETE" }
|
||||
};
|
||||
|
||||
@@ -89,7 +89,6 @@ describe("<SilencePreview />", () => {
|
||||
"./alerts.json?q=foo%3Dbar&q=%40alertmanager%3D~%5E%28amValue%29%24",
|
||||
{
|
||||
method: "GET",
|
||||
mode: "no-cors",
|
||||
credentials: "include",
|
||||
redirect: "follow"
|
||||
}
|
||||
@@ -108,7 +107,6 @@ describe("<SilencePreview />", () => {
|
||||
"./alerts.json?q=foo%3Dbar&q=%40alertmanager%3D~%5E%28am1%7Cam2%29%24",
|
||||
{
|
||||
method: "GET",
|
||||
mode: "no-cors",
|
||||
credentials: "include",
|
||||
redirect: "follow"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user