Describe the suggested improvement
Is your improvement related to a problem? Please describe.
Currently the transports are responsible to clone the dictionaries to ensure that when headers are modified during processing that these modified headers are not passed to the error context.
This header cloning results in unneeded allocations when headers are not modified.
Describe the suggested solution
Instead of Dictionary use IDictionary, this allows to use smarter dictionaries like snapshot implementation that allows reverting.
Then update all transports to not clone headers to create their message and error context which are passed to their respective pipelines.
Describe alternatives you've considered
Keeping this the same
Additional Context
No response
Describe the suggested improvement
Is your improvement related to a problem? Please describe.
Currently the transports are responsible to clone the dictionaries to ensure that when headers are modified during processing that these modified headers are not passed to the error context.
This header cloning results in unneeded allocations when headers are not modified.
Describe the suggested solution
Instead of
DictionaryuseIDictionary, this allows to use smarter dictionaries like snapshot implementation that allows reverting.Then update all transports to not clone headers to create their message and error context which are passed to their respective pipelines.
Describe alternatives you've considered
Keeping this the same
Additional Context
No response