diff options
Diffstat (limited to 'modules/caddyhttp/staticresp.go')
-rw-r--r-- | modules/caddyhttp/staticresp.go | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/modules/caddyhttp/staticresp.go b/modules/caddyhttp/staticresp.go index 44b045e..cc294d5 100644 --- a/modules/caddyhttp/staticresp.go +++ b/modules/caddyhttp/staticresp.go @@ -29,10 +29,19 @@ func init() { // StaticResponse implements a simple responder for static responses. type StaticResponse struct { - StatusCode WeakString `json:"status_code,omitempty"` - Headers http.Header `json:"headers,omitempty"` - Body string `json:"body,omitempty"` - Close bool `json:"close,omitempty"` + // The HTTP status code to respond with. Can be an integer or, + // if needing to use a placeholder, a string. + StatusCode WeakString `json:"status_code,omitempty"` + + // Header fields to set on the response. + Headers http.Header `json:"headers,omitempty"` + + // The response body. + Body string `json:"body,omitempty"` + + // If true, the server will close the client's connection + // after writing the response. + Close bool `json:"close,omitempty"` } // CaddyModule returns the Caddy module information. |