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

KeyNotFoundException when no Accept-Encoding header key exists. should fallback to no compression. #130

Closed
eladmarg opened this issue Oct 1, 2021 · 1 comment
Labels
Milestone

Comments

@eladmarg
Copy link

eladmarg commented Oct 1, 2021

attached logged exception:

System.Collections.Generic.KeyNotFoundException: The given key 'Accept-Encoding' was not present in the dictionary.
   at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
   at Microsoft.AspNetCore.HttpSys.Internal.RequestHeaders.System.Collections.Generic.IDictionary<System.String,Microsoft.Extensions.Primitives.StringValues>.get_Item(String key)
   at Smidge.RequestHelper.GetClientCompression(IDictionary`2 headers)
   at Smidge.Models.RequestModel..ctor(String valueName, IUrlManager urlManager, IActionContextAccessor accessor, IRequestHelper requestHelper)
   at Smidge.Models.BundleRequestModel..ctor(IUrlManager urlManager, IActionContextAccessor accessor, IRequestHelper requestHelper, IBundleManager bundleManager)
   at ResolveService(ILEmitResolverBuilderRuntimeContext , ServiceProviderEngineScope )
   at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider, Type serviceType)
   at Microsoft.AspNetCore.Mvc.ModelBinding.Binders.ServicesModelBinder.BindModelAsync(ModelBindingContext bindingContext)
   at Microsoft.AspNetCore.Mvc.ModelBinding.ParameterBinder.BindModelAsync(ActionContext actionContext, IModelBinder modelBinder, IValueProvider valueProvider, ParameterDescriptor parameter, ModelMetadata metadata, Object value, Object container)
   at Microsoft.AspNetCore.Mvc.Controllers.ControllerBinderDelegateProvider.<>c__DisplayClass0_0.<<CreateBinderDelegate>g__Bind|0>d.MoveNext()

@eladmarg
Copy link
Author

eladmarg commented Oct 1, 2021

maybe #128 might solves this.

@Shazwazza Shazwazza added the bug label Oct 6, 2021
@Shazwazza Shazwazza added this to the 4.0.2 milestone Oct 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants