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
{{ message }}
Repository navigation
RequestConfiguration instances share the same HeadersCollection instance by default #507
The default for RequestConfiguration.headers is an instance of HeadersCollection. This is created at class definition time, meaning that all instances of RequestConfiguration share the same instance of HeadersCollection by default. This leads to conflict when different instances of RequestConfiguration add/remove headers.
changed the title [-]HeadersCollection instances share the same HeadersCollection instance by default[/-][+]RequestConfiguration instances share the same HeadersCollection instance by default[/+]on Jan 12, 2026
Same here. Every RequestConfiguration() that omits headers= mutates one shared collection, and in an async service that talks to many mailboxes a Prefer added for one call rides along on the others. Reproduces on 1.10.1 and the line is unchanged in 1.12.0 and on main:
microsoft-kiota-abstractions 1.10.1
two configs share one HeadersCollection: True
header added on a is visible on b: {'outlook.body-content-type=text'}
The field(default_factory=HeadersCollection) fix in the description is the whole change, plus the same for HeadersInspectionHandlerOption. Happy to send that PR with a test if nobody has it in flight.
Activity
[-]HeadersCollection instances share the same HeadersCollection instance by default[/-][+]RequestConfiguration instances share the same HeadersCollection instance by default[/+]HardMax71 commentedon Sep 3, 2026
Same here. Every
RequestConfiguration()that omitsheaders=mutates one shared collection, and in an async service that talks to many mailboxes aPreferadded for one call rides along on the others. Reproduces on 1.10.1 and the line is unchanged in 1.12.0 and on main:Script: https://gist.github.com/HardMax71/515894a3c37374424ee77c5f3f5a1aa9
The
field(default_factory=HeadersCollection)fix in the description is the whole change, plus the same forHeadersInspectionHandlerOption. Happy to send that PR with a test if nobody has it in flight.