strawberry-graphql / strawberry.rocks

Website for Strawberry GraphQL
https://strawberry.rocks
MIT License
26 stars 13 forks source link

Playground share button fails (500 error for OPTIONS) #502

Closed huonw closed 4 months ago

huonw commented 4 months ago

Describe the Bug

The "Share" button on https://play.strawberry.rocks/ is currently broken:

  1. Click the button
  2. Observe "Loading..." prompt
  3. BUG: finishes loading but link box remains empty image

There's two network requests and both fail:

OPTIONS: response is a 500.

curl 'https://api.strawberry.rocks/graphql' -X OPTIONS -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:123.0) Gecko/20100101 Firefox/123.0' -H 'Accept: */*' -H 'Accept-Language: en-US,en;q=0.5' -H 'Accept-Encoding: gzip, deflate, br' -H 'Access-Control-Request-Method: POST' -H 'Access-Control-Request-Headers: content-type' -H 'Referer: https://play.strawberry.rocks/' -H 'Origin: https://play.strawberry.rocks' -H 'DNT: 1' -H 'Connection: keep-alive' -H 'Sec-Fetch-Dest: empty' -H 'Sec-Fetch-Mode: cors' -H 'Sec-Fetch-Site: same-site'

POST: doesn't seem to run, likely because the OPTIONs fails.

curl 'https://api.strawberry.rocks/graphql' -X POST -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:123.0) Gecko/20100101 Firefox/123.0' -H 'Accept: */*' -H 'Accept-Language: en-US,en;q=0.5' -H 'Accept-Encoding: gzip, deflate, br' -H 'content-type: application/json' -H 'Content-Length: 463' -H 'Origin: https://play.strawberry.rocks' -H 'DNT: 1' -H 'Connection: keep-alive' -H 'Referer: https://play.strawberry.rocks/' -H 'Sec-Fetch-Dest: empty' -H 'Sec-Fetch-Mode: cors' -H 'Sec-Fetch-Site: same-site'

System Information

Additional Context

The playground is awesome! 🍓

patrick91 commented 4 months ago

Hi @huonw thanks for the repo, I fixed it 😊