#Getting CORS on only the `/api/board/seek` endpoint

39 messages · Page 1 of 1 (latest)

wet spear
#

Im getting error CORS policy: Request header field authorzation is not allowed by Access-Control-Allow-Headers in preflight response. only when calling the /api/board/seek endpoint all other endpoints are perfectly fine

potent fern
#

there's a typo in authorzation

wet spear
#

oh my god

#

hahaha

#

british vs american english mb

barren kindle
#

Not really.. The problem is the missing i. Using a z is correct.

wet spear
#

oh waht

#

I missed an i-?

#

OH

#

I DID

#

no

#

wait no

#

im looking the wrong code

#

Thank you so much, idk how I didnt notice that 😭

wet spear
# barren kindle Not really.. The problem is the missing i. Using a z is correct.

uhm, Do you have any idea why im getting "Invalid time control"
Im passing it in this code

    await fetch("https://lichess.org/api/board/seek", {
        method: 'post',
        headers: { Authorization: "Bearer " + lichessAuth },
        body: new URLSearchParams({
            rated: rated,
            time: currentTimeControl.time,
            increment: currentTimeControl.increment
        })
    }).then(i => i.json().then(console.log));
```Ive tried `rated` being true and false, and time/increment being 1/0, 1/3, 3/0 and 5/3
barren kindle
#

I think the time is in seconds. Check the API docs.

wet spear
#

The time in mins

#

The increment is seconds

barren kindle
#

Also, not sure you can seek bullet games. Should be listed in the docs somewhere as well.

wet spear
#

I couldnt seek blitz either

#

hm

#

interesting

barren kindle
#

Well, check the docs, it says somewhere which ones are allowed

wet spear
#

I can seek rapid though

#

Wait so how would I match into a random bullet game?

barren kindle
#

You can't

wet spear
#

oh

#

bruh

#

thats kinda dumb

#

also they should change this then

#

cuz that leads me to believe I can do any number from 0 - 180

barren kindle
#

Well, it's not technically wrong, you probably can do something like 0/180 or 10/0.

#

Though I guess it would make sense to mention the restrictions somewhere there

wet spear
#

Mhm I dont see where it says abt the restrictions

#

Imo they should allow you to seek bullet games

barren kindle
#

It's definitely mentioned somewhere in the docs. Maybe at the start of the board API section. Iirc you can play bullet via direct challenges. Iirc it's due to cheating but don't remember exactly.

wet spear
#

that doesnt really make sense for cheating reasons

#

they can just go cheat in 10m like-?