Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions mcpgateway/services/gateway_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -799,6 +799,20 @@ async def update_gateway(self, db: Session, gateway_id: str, gateway_update: Gat
gateway.transport = gateway_update.transport
if gateway_update.tags is not None:
gateway.tags = gateway_update.tags
if gateway_update.passthrough_headers is not None:
if isinstance(gateway_update.passthrough_headers, list):
gateway.passthrough_headers = gateway_update.passthrough_headers
else:
if isinstance(gateway_update.passthrough_headers, str):
parsed = [h.strip() for h in gateway_update.passthrough_headers.split(",") if h.strip()]
gateway.passthrough_headers = parsed
else:
raise GatewayError(
"Invalid passthrough_headers format: must be list[str] or comma-separated string")

logger.info(
"Updated passthrough_headers for gateway {gateway.id}: {gateway.passthrough_headers}"
)

if getattr(gateway, "auth_type", None) is not None:
gateway.auth_type = gateway_update.auth_type
Expand Down