Skip to content

Conversation

@darrelmiller
Copy link
Contributor

Currently when the GraphClientFactory builds a middleware pipeline, it checks to see if a handler already has InnerHandler set. If it is, it throws an exception.
This causes a problem for handlers that set a finalhandler by default in their constructor. This is a fairly common pattern.

This PR changes the behaviour to simply overwrite any existing InnerHandler. The idea is that if a developer provides 4 handlers explicitly in the array, then the pipeline should contain exactly just those 4 handlers plus the finalhandler.

MIchaelMainer
MIchaelMainer previously approved these changes Oct 21, 2019
Copy link
Collaborator

@MIchaelMainer MIchaelMainer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. It would be helpful that we document this behavior on line 79 to indicate that any inner handler reference will be overwritten.

@MIchaelMainer MIchaelMainer merged commit ada4500 into dev Oct 23, 2019
@MIchaelMainer MIchaelMainer deleted the dm/clearinnerhandler branch October 23, 2019 22:43
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

Successfully merging this pull request may close these issues.

3 participants