From 1afb103be10c5c075099228120fba84f9d2a384c Mon Sep 17 00:00:00 2001 From: Nika Hassani Date: Fri, 13 Oct 2023 13:05:55 -0700 Subject: [PATCH] fix(logging): not sign the empty body of the get remote config request --- .../lib/src/remote_constraint_provider.dart | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/remote_constraint_provider.dart b/packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/remote_constraint_provider.dart index 922af4c043..bc51696495 100644 --- a/packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/remote_constraint_provider.dart +++ b/packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/remote_constraint_provider.dart @@ -32,7 +32,8 @@ base class BaseRemoteLoggingConstraintProvider FileStorage? fileStorage, }) : _fileStorage = fileStorage, _config = config, - _awsHttpClient = AWSHttpClient() { + _awsHttpClient = AWSHttpClient() + ..supportedProtocols = SupportedProtocols.http1 { _init(); } @@ -120,9 +121,10 @@ base class BaseRemoteLoggingConstraintProvider jsonEncode(fetchedConstraint.toJson()), ); } - } on Exception catch (exception) { + } on Object catch (exception, st) { logger.error( - 'Failed to fetch logging constraint from ${_config.endpoint}: $exception', + 'Failed to fetch logging constraint from ${_config.endpoint}. exception: $exception, stack: $st', + st, ); } } @@ -194,6 +196,7 @@ final class DefaultRemoteLoggingConstraintProvider final signedRequest = await _signer.sign( baseRequest, credentialScope: scope, + serviceConfiguration: const ServiceConfiguration(signBody: false), ); return signedRequest;