diff --git a/builder/build.sh b/builder/build.sh index 9755600..069034e 100755 --- a/builder/build.sh +++ b/builder/build.sh @@ -132,7 +132,10 @@ EOF import sys, json routes = json.load(sys.stdin) new_host = '${APP_ID}.${DOMAIN_SUFFIX}' -routes = [r for r in routes if new_host not in r.get('match',[{}])[0].get('host',[])] +routes = [r for r in routes + if not (isinstance(r, dict) + and any(isinstance(m, dict) and new_host in m.get('host', []) + for m in r.get('match', [])))] routes.append(json.loads(sys.argv[1])) print(json.dumps(routes)) " "$ROUTE_JSON")