caddy/modules/caddyhttp/fileserver
kylosus 45132c5b24
caddyhttp: Add plaintext response to file_server browse (#6093)
* Added plaintext support to file_server browser

This commit is twofold: First it adds a new optional
field, `return_type`, to `browser` for setting the
default format of the returned index (html, json or plaintext).
This is used when the `Accept` header is set to `/*`.

Second, it adds a preliminary `text/plain`
support to the `file_server` browser that
returns a text representation of the file
system, when an `Accept: text/plain` header
is present, with the behavior discussed above.

* Added more details and better formatting to plaintext browser

* Replaced returnType conditions with a switch statement

* Simplify

---------

Co-authored-by: Matt Holt <mholt@users.noreply.github.com>
2024-04-01 18:12:40 +00:00
..
testdata fileserver: Support glob expansion in file matcher (#4993) 2022-09-05 13:53:41 -06:00
browse.go caddyhttp: Add plaintext response to file_server browse (#6093) 2024-04-01 18:12:40 +00:00
browse.html fileserver: Browse can show symlink target if enabled (#5973) 2024-02-06 04:31:26 +00:00
browsetplcontext.go fileserver: Browse can show symlink target if enabled (#5973) 2024-02-06 04:31:26 +00:00
browsetplcontext_test.go fileserver: Use EscapedPath for browse (#5534) 2023-05-15 10:48:05 -06:00
caddyfile.go caddyhttp: Add plaintext response to file_server browse (#6093) 2024-04-01 18:12:40 +00:00
command.go fileserver: Browse can show symlink target if enabled (#5973) 2024-02-06 04:31:26 +00:00
matcher.go caddyhttp: upgrade to cel v0.20.0 (#6161) 2024-03-13 21:32:42 -06:00
matcher_test.go filesystem: Globally declared filesystems, fs directive (#5833) 2024-01-13 20:12:43 +00:00
staticfiles.go fileserver: Preserve query during canonicalization redirect (#6109) 2024-03-05 22:51:26 -07:00
staticfiles_test.go caddyhttp: Refactor and export SanitizedPathJoin for use in fastcgi (#4207) 2021-06-17 09:59:08 -06:00