Skip to content

Commit ca27b82

Browse files
save passthrough headers in update gateway
Signed-off-by: Arjav <[email protected]>
1 parent c30cbf5 commit ca27b82

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

mcpgateway/services/gateway_service.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -799,7 +799,22 @@ async def update_gateway(self, db: Session, gateway_id: str, gateway_update: Gat
799799
gateway.transport = gateway_update.transport
800800
if gateway_update.tags is not None:
801801
gateway.tags = gateway_update.tags
802+
if gateway_update.passthrough_headers is not None:
803+
if isinstance(gateway_update.passthrough_headers, list):
804+
gateway.passthrough_headers = gateway_update.passthrough_headers
805+
else:
806+
if isinstance(gateway_update.passthrough_headers, str):
807+
parsed = [h.strip() for h in gateway_update.passthrough_headers.split(",") if h.strip()]
808+
gateway.passthrough_headers = parsed
809+
else:
810+
raise GatewayError(
811+
"Invalid passthrough_headers format: must be list[str] or comma-separated string")
812+
813+
logger.info(
814+
"Updated passthrough_headers for gateway {gateway.id}: {gateway.passthrough_headers}"
815+
)
802816

817+
gateway.updated_at = datetime.now(timezone.utc)
803818
if getattr(gateway, "auth_type", None) is not None:
804819
gateway.auth_type = gateway_update.auth_type
805820

0 commit comments

Comments
 (0)