mirror of
https://github.com/samanhappy/mcphub.git
synced 2026-01-01 04:08:52 -05:00
Fix: Environment variable expansion in headers for HTTP-based MCP transports (#380)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: samanhappy <2755122+samanhappy@users.noreply.github.com>
This commit is contained in:
@@ -162,7 +162,7 @@ const createTransportFromConfig = (name: string, conf: ServerConfig): any => {
|
||||
const options: any = {};
|
||||
if (conf.headers && Object.keys(conf.headers).length > 0) {
|
||||
options.requestInit = {
|
||||
headers: conf.headers,
|
||||
headers: replaceEnvVars(conf.headers),
|
||||
};
|
||||
}
|
||||
transport = new StreamableHTTPClientTransport(new URL(conf.url || ''), options);
|
||||
@@ -171,10 +171,10 @@ const createTransportFromConfig = (name: string, conf: ServerConfig): any => {
|
||||
const options: any = {};
|
||||
if (conf.headers && Object.keys(conf.headers).length > 0) {
|
||||
options.eventSourceInit = {
|
||||
headers: conf.headers,
|
||||
headers: replaceEnvVars(conf.headers),
|
||||
};
|
||||
options.requestInit = {
|
||||
headers: conf.headers,
|
||||
headers: replaceEnvVars(conf.headers),
|
||||
};
|
||||
}
|
||||
transport = new SSEClientTransport(new URL(conf.url), options);
|
||||
|
||||
Reference in New Issue
Block a user