Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong casing in ETag crashes with InvalidOperationException #293

Closed
loraderon opened this issue Sep 6, 2023 · 1 comment
Closed

Wrong casing in ETag crashes with InvalidOperationException #293

loraderon opened this issue Sep 6, 2023 · 1 comment

Comments

@loraderon
Copy link

I think that the issue has to do with the casing of the ETag response header. It seems like azureedge.net (sometimes) responds with the header Etag instead of ETag.

var client = ClientExtensions.CreateClient();
const string CacheableResource = "https://nexaprod.azureedge.net/dist/assets/brand/images/sliders/highlights_arrow_left.webp";
var response = client.GetAsync(CacheableResource).
    ConfigureAwait(false).GetAwaiter().GetResult();
var responseFromCache = client.GetAsync(CacheableResource).
    ConfigureAwait(false).GetAwaiter().GetResult();
{
  "ClassName": "System.InvalidOperationException",
  "Message": "Error parsing HTTP message header byte 370 of message System.Byte[].",
  "Data": null,
  "InnerException": null,
  "HelpURL": null,
  "StackTraceString": "
at System.Net.Http.HttpContentMessageExtensions.ReadAsHttpResponseMessageAsyncCore(HttpContent content, Int32 bufferSize, Int32 maxHeaderSize, CancellationToken cancellationToken)
   at CacheCow.Client.MessageContentHttpMessageSerializer.DeserializeToResponseAsync(Stream stream)
   at CacheCow.Client.InMemoryCacheStore.GetValueAsync(CacheKey key)
   at CacheCow.Client.CachingHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
   at System.Net.Http.HttpClient.<SendAsync>g__Core|83_0(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationTokenSource cts, Boolean disposeCts, CancellationTokenSource pendingRequestsCts, CancellationToken originalCancellationToken)
   at UserQuery.Main() in C:\\Users\\Anders\\AppData\\Local\\Temp\\LINQPad7\\_omgtoavv\\jqnnqv\\LINQPadQuery:line 32
",
  "RemoteStackTraceString": null,
  "RemoteStackIndex": 0,
  "ExceptionMethod": null,
  "HResult": -2146233079,
  "Source": "System.Net.Http.Formatting",
  "WatsonBuckets": null
}
@loraderon
Copy link
Author

Sorry, this is probably a duplicate of #213

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant