File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed
modules/caddyhttp/fileserver Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -60,7 +60,23 @@ func init() {
60
60
// requested directory does not have an index file, Caddy writes a
61
61
// 404 response. Alternatively, file browsing can be enabled with
62
62
// the "browse" parameter which shows a list of files when directories
63
- // are requested if no index file is present.
63
+ // are requested if no index file is present. If "browse" is enabled,
64
+ // Caddy may serve a JSON array of the dirctory listing when the `Accept`
65
+ // header mentions `application/json` with the following structure:
66
+ //
67
+ // [{
68
+ // "name": "",
69
+ // "size": 0,
70
+ // "url": "",
71
+ // "mod_time": "",
72
+ // "mode": 0,
73
+ // "is_dir": false,
74
+ // "is_symlink": false
75
+ // }]
76
+ //
77
+ // with the `url` being relative to the request path and `mod_time` in the RFC 3339 format
78
+ // with sub-second precision. For any other value for the `Accept` header, the
79
+ // respective browse template is executed with `Content-Type: text/html`.
64
80
//
65
81
// By default, this handler will canonicalize URIs so that requests to
66
82
// directories end with a slash, but requests to regular files do not.
You can’t perform that action at this time.
0 commit comments