misskey icon indicating copy to clipboard operation
misskey copied to clipboard

webhookがcontent-type text/plain;charset=UTF-8 で飛んでくる

Open fruitriin opened this issue 3 years ago • 0 comments

💡 Summary

webhookとして登録したエンドポイントにmisskeyが content-type text/plain;charset=UTF-8 でリクエストを投げてくる。 express が jsonパーサーしか用意してない場合、このリクエストはパースされず、空のbodyであると認識する。

🥰 Expected Behavior

content-type | application/json

🤬 Actual Behavior

content-type | text/plain;charset=UTF-8

📝 Steps to Reproduce

  1. webhookを登録する(webhook.site が便利)
  2. 飛んでくる webhookのheaderを確認する

Note: この修正を行うと JSON.parse() 的な処理が必要だったところが不要になったりして今まで動いてたwebhookが壊れる可能性あり

📌 Environment

Misskey version: 13.3.4 Your OS: Your browser:

fruitriin avatar Feb 06 '23 13:02 fruitriin