mirror of
https://github.com/labring/FastGPT.git
synced 2025-12-25 20:02:47 +00:00
fix: mcp sse params (#6056)
* mcp sse params * add console * fix * node version
This commit is contained in:
parent
5aaf123135
commit
e979f69cba
|
|
@ -41,14 +41,23 @@ export class MCPClient {
|
||||||
},
|
},
|
||||||
eventSourceInit: {
|
eventSourceInit: {
|
||||||
fetch: (url, init) => {
|
fetch: (url, init) => {
|
||||||
const headers = new Headers({
|
const mergedHeaders: Record<string, string> = {
|
||||||
...init?.headers,
|
|
||||||
...this.headers
|
...this.headers
|
||||||
});
|
};
|
||||||
|
|
||||||
|
if (init?.headers) {
|
||||||
|
if (init.headers instanceof Headers) {
|
||||||
|
init.headers.forEach((value, key) => {
|
||||||
|
mergedHeaders[key] = value;
|
||||||
|
});
|
||||||
|
} else if (typeof init.headers === 'object') {
|
||||||
|
Object.assign(mergedHeaders, init.headers);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return fetch(url, {
|
return fetch(url, {
|
||||||
...init,
|
...init,
|
||||||
headers
|
headers: mergedHeaders
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -150,6 +150,9 @@ const WorkflowInitContextProvider = ({
|
||||||
name: node.data.name,
|
name: node.data.name,
|
||||||
parentNodeId: node.data.parentNodeId,
|
parentNodeId: node.data.parentNodeId,
|
||||||
flowNodeType: node.data.flowNodeType,
|
flowNodeType: node.data.flowNodeType,
|
||||||
|
version: node.data.version,
|
||||||
|
versionLabel: node.data.versionLabel,
|
||||||
|
isLatestVersion: node.data.isLatestVersion,
|
||||||
inputs: node.data.inputs.map((input) => {
|
inputs: node.data.inputs.map((input) => {
|
||||||
return {
|
return {
|
||||||
key: input.key,
|
key: input.key,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue