From bc00d840e845d42145954839b88f1e836cd51bfd Mon Sep 17 00:00:00 2001 From: Matthew Holt Date: Wed, 22 May 2019 12:32:36 -0600 Subject: Export types and fields necessary to build configs (for config adapters) Also flag most fields with 'omitempty' for JSON marshaling --- modules/caddyhttp/rewrite/rewrite.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'modules/caddyhttp/rewrite') diff --git a/modules/caddyhttp/rewrite/rewrite.go b/modules/caddyhttp/rewrite/rewrite.go index b7878a5..b898b1f 100644 --- a/modules/caddyhttp/rewrite/rewrite.go +++ b/modules/caddyhttp/rewrite/rewrite.go @@ -18,9 +18,9 @@ func init() { // Rewrite is a middleware which can rewrite HTTP requests. type Rewrite struct { - Method string `json:"method"` - URI string `json:"uri"` - Rehandle bool `json:"rehandle"` + Method string `json:"method,omitempty"` + URI string `json:"uri,omitempty"` + Rehandle bool `json:"rehandle,omitempty"` } func (rewr Rewrite) ServeHTTP(w http.ResponseWriter, r *http.Request, next caddyhttp.Handler) error { -- cgit v1.2.3