Skip to content

Flatten HTTP handler config#2663

Merged
mholt merged 1 commit intov2from
v2-handlers
Jul 11, 2019
Merged

Flatten HTTP handler config#2663
mholt merged 1 commit intov2from
v2-handlers

Conversation

@mholt
Copy link
Member

@mholt mholt commented Jul 9, 2019

1. What does this change do, exactly?

Makes v2's handler config linear, as opposed to nested.

Differentiating middleware and responders has one benefit, namely that
it's clear which module provides the response, but even then it's not
a great advantage. Linear handler config makes a little more sense,
giving greater flexibility and simplifying the core a bit, even though
it's slightly awkward that handlers which are responders may not use
the 'next' handler that is passed in at all.

2. Please link to the relevant issues.

#2662

3. Which documentation changes (if any) need to be made because of this PR?

Update the wiki to show the flattened config structure for handlers.

Differentiating middleware and responders has one benefit, namely that
it's clear which module provides the response, but even then it's not
a great advantage. Linear handler config makes a little more sense,
giving greater flexibility and simplifying the core a bit, even though
it's slightly awkward that handlers which are responders may not use
the 'next' handler that is passed in at all.
@mholt mholt added the Caddy2 label Jul 9, 2019
@mholt mholt added this to the 2.0 milestone Jul 9, 2019
@mholt mholt requested a review from dannav July 9, 2019 19:01
@mholt mholt self-assigned this Jul 9, 2019
Copy link
Contributor

@dannav dannav 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 to me

@mholt mholt merged commit 9343403 into v2 Jul 11, 2019
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.

2 participants