parseCaddyfile parses the file_server directive. See UnmarshalCaddyfile for the syntax.
(h httpcaddyfile.Helper)
| 36 | // parseCaddyfile parses the file_server directive. |
| 37 | // See UnmarshalCaddyfile for the syntax. |
| 38 | func parseCaddyfile(h httpcaddyfile.Helper) (caddyhttp.MiddlewareHandler, error) { |
| 39 | fsrv := new(FileServer) |
| 40 | err := fsrv.UnmarshalCaddyfile(h.Dispenser) |
| 41 | if err != nil { |
| 42 | return fsrv, err |
| 43 | } |
| 44 | err = fsrv.FinalizeUnmarshalCaddyfile(h) |
| 45 | if err != nil { |
| 46 | return nil, err |
| 47 | } |
| 48 | return fsrv, err |
| 49 | } |
| 50 | |
| 51 | // UnmarshalCaddyfile parses the file_server directive. It enables |
| 52 | // the static file server and configures it with this syntax: |
nothing calls this directly
no test coverage detected