Skip to content

Commit f033925

Browse files
authored
Merge pull request #60 from danmoz/opencode/issue46-20260905061802
Doc'd `ServeHTTP` as terminal handler.
2 parents 6021143 + 905377b commit f033925

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

‎middleware.go‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,9 @@ func (m *Lambda) Validate() error {
145145
}
146146

147147
// ServeHTTP implements caddyhttp.MiddlewareHandler.
148+
//
149+
// This is a terminal handler: it writes the response directly and never
150+
// calls next, so subsequent handlers in a route chain are not executed.
148151
func (m *Lambda) ServeHTTP(w http.ResponseWriter, r *http.Request, _ caddyhttp.Handler) error {
149152
req, err := newRequestForFormat(w, r, m.eventFormat(), m.MaxBodySize, m.UpstreamHeaders)
150153
if err != nil {

0 commit comments

Comments
 (0)