mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2026-01-02 02:09:03 +08:00
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:
parent
c02a06ba7b
commit
d9e336f136
@ -96,7 +96,8 @@ const MCPSettings: FC = () => {
|
|||||||
if (values.env) {
|
if (values.env) {
|
||||||
values.env.split('\n').forEach((line) => {
|
values.env.split('\n').forEach((line) => {
|
||||||
if (line.trim()) {
|
if (line.trim()) {
|
||||||
const [key, value] = line.split('=')
|
const [key, ...chunks] = line.split('=')
|
||||||
|
const value = chunks.join('=')
|
||||||
if (key && value) {
|
if (key && value) {
|
||||||
env[key.trim()] = value.trim()
|
env[key.trim()] = value.trim()
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user