aboutsummaryrefslogtreecommitdiffstats
path: root/examples/file_server/src/file_server_app.erl
diff options
context:
space:
mode:
authorlin <lin@debian>2023-02-15 00:30:18 +0800
committerLoïc Hoguin <[email protected]>2023-12-07 15:31:11 +0100
commit4f26d6a5730685d00ed1533fe33dc2eb3a51a4e8 (patch)
tree23e6b8126f5fbd0e9e795ec7e3d15c2b7000cbca /examples/file_server/src/file_server_app.erl
parent32594a51994c70cfa1a82119a7d439af98c384b4 (diff)
downloadcowboy-4f26d6a5730685d00ed1533fe33dc2eb3a51a4e8.tar.gz
cowboy-4f26d6a5730685d00ed1533fe33dc2eb3a51a4e8.tar.bz2
cowboy-4f26d6a5730685d00ed1533fe33dc2eb3a51a4e8.zip
Add UTF-8 support to example file_server
LH: I have fixed issues in the PR and incorporated changes from a sister PR by @djankovic (git author: Dom J). I also made sure the UTF-8 files were readable without Chinese fonts and added their downloading to the examples test suite.
Diffstat (limited to 'examples/file_server/src/file_server_app.erl')
-rw-r--r--examples/file_server/src/file_server_app.erl3
1 files changed, 2 insertions, 1 deletions
diff --git a/examples/file_server/src/file_server_app.erl b/examples/file_server/src/file_server_app.erl
index 17e73b2..0ba8f6c 100644
--- a/examples/file_server/src/file_server_app.erl
+++ b/examples/file_server/src/file_server_app.erl
@@ -15,7 +15,8 @@ start(_Type, _Args) ->
{'_', [
{"/[...]", cowboy_static, {priv_dir, file_server, "", [
{mimetypes, cow_mimetypes, all},
- {dir_handler, directory_h}
+ {dir_handler, directory_h},
+ {charset, <<"utf-8">>}
]}}
]}
]),