mirror of
https://github.com/tcgdex/javascript-sdk.git
synced 2025-04-22 10:42:10 +00:00
Fix Cross-Origin Request Blocked
This commit is contained in:
parent
6621316e8d
commit
8ae2b2dcb7
@ -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})`)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user