You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
QCAlgorithm.Download permits AWS S3 Authentication Headers. The code for Download appears to have changed in #7976 from WebClient to HttpClient which adds strict header validation when using .Add to add a header
Actual Behavior
Exception: Unhandled exception. System.FormatException: The format of value 'AWS4-HMAC-SHA256 Credential=AKIAIOSFODNN7EXAMPLE/20130524/us-east-1/s3/aws4_request, SignedHeaders=host;range;x-amz-date,Signature=EXAMPLE_SIGNATURE' is invalid.
Potential Solution
In Api.cs DownloadBytes, use client.Value.TryAddWithoutValidation(header.Key, header.Value); instead of client.Value.DefaultRequestHeaders.Add(header.Key, header.Value);
Expected Behavior
QCAlgorithm.Download permits AWS S3 Authentication Headers. The code for Download appears to have changed in #7976 from
WebClient
toHttpClient
which adds strict header validation when using.Add
to add a headerActual Behavior
Exception:
Unhandled exception. System.FormatException: The format of value 'AWS4-HMAC-SHA256 Credential=AKIAIOSFODNN7EXAMPLE/20130524/us-east-1/s3/aws4_request, SignedHeaders=host;range;x-amz-date,Signature=EXAMPLE_SIGNATURE' is invalid.
Potential Solution
In Api.cs DownloadBytes, use
client.Value.TryAddWithoutValidation(header.Key, header.Value);
instead ofclient.Value.DefaultRequestHeaders.Add(header.Key, header.Value);
Reproducing the Problem
In QuantConnect
Unit Test
Outside QuantConnect
System Information
Windows 11
Checklist
master
branchThe text was updated successfully, but these errors were encountered: