fix(MCPSettings): MCP server environment variables parsing error

If there is one or more equal (=) sign in value part, all would be lost
This commit is contained in:
Chris Wan 2025-03-12 23:18:45 +08:00 committed by 亢奋猫
parent bac4dcf73c
commit 42b8b696a2

View File

@ -96,7 +96,8 @@ const MCPSettings: FC = () => {
if (values.env) {
values.env.split('\n').forEach((line) => {
if (line.trim()) {
const [key, value] = line.split('=')
const [key, ...chunks] = line.split('=')
const value = chunks.join('=')
if (key && value) {
env[key.trim()] = value.trim()
}