Fix Cross-Origin Request Blocked

This commit is contained in:
Florian Bouillon 2020-06-23 00:10:03 +02:00 committed by GitHub
parent 6621316e8d
commit 8ae2b2dcb7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -35,7 +35,11 @@ export class Request<T = any> {
// Fetch Response // Fetch Response
try { try {
const resp = await fetch(this.url) const resp = await fetch(this.url, {
headers: {
"Content-Type": "text/plain"
}
})
if (resp.status !== 200) { if (resp.status !== 200) {
throw new Error(`Error request ended with the code (${resp.status})`) throw new Error(`Error request ended with the code (${resp.status})`)
} }