From c66926f5552ce39e93260941b39aebd3ca55816c Mon Sep 17 00:00:00 2001 From: Pete Kruskall Date: Fri, 4 Sep 2020 00:45:04 -0400 Subject: [PATCH] Updating pet store sample templates --- .../dart2/petstore_client_lib/lib/auth/api_key_auth.dart | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/samples/client/petstore/dart2/petstore_client_lib/lib/auth/api_key_auth.dart b/samples/client/petstore/dart2/petstore_client_lib/lib/auth/api_key_auth.dart index 8384f0516ce2..78ffb2e0a216 100644 --- a/samples/client/petstore/dart2/petstore_client_lib/lib/auth/api_key_auth.dart +++ b/samples/client/petstore/dart2/petstore_client_lib/lib/auth/api_key_auth.dart @@ -24,6 +24,10 @@ class ApiKeyAuth implements Authentication { queryParams.add(QueryParam(paramName, value)); } else if (location == 'header' && value != null) { headerParams[paramName] = value; + } else if (location == 'cookie' && value != null) { + headerParams.update('Cookie', (String existingCookie) { + return "$existingCookie; $paramName=$value"; + }, ifAbsent: () => '$paramName=$value'); } } }