Open saschanaz opened 1 year ago
See also: #9355
curl -X POST -H "Content-Type: application/json" https://p1.a9z.dev/api/meta
γ― {"statusCode":400,"code":"FST_ERR_CTP_EMPTY_JSON_BODY","error":"Bad Request","message":"Body cannot be empty when content-type is set to 'application/json'"} γͺγγ γγ©θ¦ζ Όγ¨γ―γγγ‘γγ£γ¨ε³γγγ¨γγγ§γ―γγ
Probably because b75184ec8e3436200bacdcd832e3324702553d20 added validate()
on endpoint-base.ts
and each meta indeed requires an object:
γγγ¨γγγγγAPIγ―GETγ«γε―ΎεΏγγζΉγγ¦γΌγΆγΌγ¨γγ¦γ―ζ₯½γ γ¨ζγγΎγ
π‘ Summary
Some endpoints don't have a required parameter but still asks an object as a POST body
π₯° Expected Behavior
Don't ask the body
π€¬ Actual Behavior
It does
π Steps to Reproduce
curl -X POST https://misskey.io/api/meta
curl -X POST https://p1.a9z.dev/api/meta
curl -X POST -H "Content-Type: application/json" -d "{}" https://p1.a9z.dev/api/meta
1 and 3 succeeds, 2 fails.
π Environment
Misskey version: 12.x vs 13.x Your OS: Windows 11 Your browser: Firefox