From ca27b820e024a84e887b43eae9c97017379d81e5 Mon Sep 17 00:00:00 2001 From: Arjav Date: Wed, 3 Sep 2025 13:07:05 +0530 Subject: [PATCH 1/2] save passthrough headers in update gateway Signed-off-by: Arjav --- mcpgateway/services/gateway_service.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/mcpgateway/services/gateway_service.py b/mcpgateway/services/gateway_service.py index af8f9607e..a834587d6 100644 --- a/mcpgateway/services/gateway_service.py +++ b/mcpgateway/services/gateway_service.py @@ -799,7 +799,22 @@ 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}" + ) + gateway.updated_at = datetime.now(timezone.utc) if getattr(gateway, "auth_type", None) is not None: gateway.auth_type = gateway_update.auth_type From 22fcf8105f1ca1aa65343772da0a1ef0136e1975 Mon Sep 17 00:00:00 2001 From: Arjav Date: Wed, 3 Sep 2025 13:07:54 +0530 Subject: [PATCH 2/2] remove updated_at Signed-off-by: Arjav --- mcpgateway/services/gateway_service.py | 1 - 1 file changed, 1 deletion(-) diff --git a/mcpgateway/services/gateway_service.py b/mcpgateway/services/gateway_service.py index a834587d6..67652c5ba 100644 --- a/mcpgateway/services/gateway_service.py +++ b/mcpgateway/services/gateway_service.py @@ -814,7 +814,6 @@ async def update_gateway(self, db: Session, gateway_id: str, gateway_update: Gat "Updated passthrough_headers for gateway {gateway.id}: {gateway.passthrough_headers}" ) - gateway.updated_at = datetime.now(timezone.utc) if getattr(gateway, "auth_type", None) is not None: gateway.auth_type = gateway_update.auth_type