Merge pull request #1161 from prymitive/revert-no-cors

fix(ui): revert use mode:no-cors for fetch GET requests
This commit is contained in:
Łukasz Mierzwa
2019-11-14 20:10:22 +00:00
committed by GitHub
3 changed files with 2 additions and 15 deletions
+1 -12
View File
@@ -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));
+1 -1
View File
@@ -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"
}