App.tsx: Remove headers in request
This commit is contained in:
parent
87baffefff
commit
2a445cfdc2
2 changed files with 5 additions and 13 deletions
12
src/App.tsx
12
src/App.tsx
|
@ -121,16 +121,10 @@ class App extends React.Component<IAppProps> {
|
||||||
|
|
||||||
async function fetchConfiguration(): Promise<Configuration> {
|
async function fetchConfiguration(): Promise<Configuration> {
|
||||||
const url = `${import.meta.env.VITE_API_URL}`;
|
const url = `${import.meta.env.VITE_API_URL}`;
|
||||||
const myHeaders = new Headers({
|
|
||||||
'Content-Type': 'application/json'
|
|
||||||
});
|
|
||||||
|
|
||||||
const myInit = {
|
return await fetch(url, {
|
||||||
method: 'POST',
|
method: 'POST'
|
||||||
headers: myHeaders
|
})
|
||||||
};
|
|
||||||
|
|
||||||
return await fetch(url, myInit)
|
|
||||||
.then((response) =>
|
.then((response) =>
|
||||||
response.json()
|
response.json()
|
||||||
) as Configuration;
|
) as Configuration;
|
||||||
|
|
|
@ -37,8 +37,7 @@ serve({
|
||||||
status: 200,
|
status: 200,
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
'Access-Control-Allow-Origin': '*',
|
'Access-Control-Allow-Origin': '*'
|
||||||
'Access-Control-Allow-Headers': '*'
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -47,8 +46,7 @@ serve({
|
||||||
status: 200,
|
status: 200,
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'text/plain',
|
'Content-Type': 'text/plain',
|
||||||
'Access-Control-Allow-Origin': '*',
|
'Access-Control-Allow-Origin': '*'
|
||||||
'Access-Control-Allow-Headers': '*'
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue