New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug] Plugin requests not set content-type header as json #2216
Comments
Thank you for raising an issue. We will investigate into the matter and get back to you as soon as possible. |
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 A monkey patch would be to just add a header into 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
The text was updated successfully, but these errors were encountered: