This change ensures that the Prometheus plugin does not side effect other plugins which interpret the status code returned from ServeHTTP in various ways. For example, some plugins, like errors (caddy/caddyhttp/errors/errors.go), interpret status code 0 as an already-written response. If the proxy plugin returns 0 and this plugin changes the status code to something other than 0, unexpected behavior can result.
Fixes #27
This change ensures that the Prometheus plugin does not side effect other plugins which interpret the status code returned from
ServeHTTP
in various ways. For example, some plugins, like errors (caddy/caddyhttp/errors/errors.go), interpret status code 0 as an already-written response. If the proxy plugin returns 0 and this plugin changes the status code to something other than 0, unexpected behavior can result.