Open ifsheldon opened 2 months ago
👀 @ifsheldon
Thank you for raising an issue. We will investigate into the matter and get back to you as soon as possible. Please make sure you have given us as much context as possible.\ 非常感谢您提交 issue。我们会尽快调查此事,并尽快回复您。 请确保您已经提供了尽可能多的背景信息。
I think it might be a mistake.
@arvinxx Do you know where to fix it? I can try to make a PR
@ifsheldon do you mean the gateway send plugin request?
if you mean the gateway, the caller is here: https://github.com/lobehub/chat-plugins-gateway/blob/main/src/gateway.ts#L243-L258
and the plugin setting code : https://github.com/lobehub/chat-plugin-sdk/blob/master/src/request.ts#L27-L33
I saw the plugin setting code before, but it's a bit twisted for me. I don't know where the settings
come from.
A monkey patch would be to just add a header into settings
. but I think probably it's best to go way back to OpenAPI parsing and see what content type the OpenAPI configs require.
What do you think? @arvinxx
💻 Operating System
macOS
📦 Environment
Vercel / Zeabur / Sealos
🌐 Browser
Safari
🐛 Bug Description
Hi! I'm developing a custom plugin. I turned on a middleware which checks if a post request has set
content-type
header asapplication/json
, but then I found the post requests with arguments in JSON from the plugin failed because the http requests setcontent-type
astext/plain
. So I wonder if this behaviour is intended or is a minor bug.🚦 Expected Behavior
I don't know if this behaviour is intended or is a minor bug. If it's a bug, we should set post requests with JSON payload and correct
content-type
header.📷 Recurrence Steps
You can set up a mock plugin and check if the post requests received have set correct
content-type
header.📝 Additional Information
No response