GraphiQL request with "accept: application/json" fails
This crashes (error 500):
curl 'https://codestats.net/profile-graphiql' \
-H 'authority: codestats.net' \
-H 'pragma: no-cache' \
-H 'cache-control: no-cache' \
-H 'accept: application/json' \
-H 'dnt: 1' \
-H 'user-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.102 Safari/537.36' \
-H 'content-type: application/json' \
-H 'origin: https://codestats.net' \
-H 'sec-fetch-site: same-origin' \
-H 'sec-fetch-mode: cors' \
-H 'sec-fetch-dest: empty' \
-H 'referer: https://codestats.net/profile-graphiql' \
-H 'accept-language: pt-BR,pt;q=0.9,en-US;q=0.8,en;q=0.7' \
--data-binary '{"query":"{\n profile(username: \"Aviortheking\") {\n day_language_xps: dayLanguageXps(since: \"2020-09-20\") {date language xp}\n }\n }","variables":null,"operationName":null}' \
--compressed -v
This works:
curl 'https://codestats.net/profile-graphiql' \
-H 'authority: codestats.net' \
-H 'pragma: no-cache' \
-H 'cache-control: no-cache' \
-H 'dnt: 1' \
-H 'user-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.102 Safari/537.36' \
-H 'content-type: application/json' \
-H 'origin: https://codestats.net' \
-H 'sec-fetch-site: same-origin' \
-H 'sec-fetch-mode: cors' \
-H 'sec-fetch-dest: empty' \
-H 'referer: https://codestats.net/profile-graphiql' \
-H 'accept-language: pt-BR,pt;q=0.9,en-US;q=0.8,en;q=0.7' \
--data-binary '{"query":"{\n profile(username: \"Aviortheking\") {\n day_language_xps: dayLanguageXps(since: \"2020-09-20\") {date language xp}\n }\n }","variables":null,"operationName":null}' \
--compressed -v
Only difference is the missing accept: application/json
header. But the header is correct and the server shouldn't crash in that situation.