aboutsummaryrefslogtreecommitdiffstats
path: root/lib/inets/src/http_server
diff options
context:
space:
mode:
authorZandra Hird <[email protected]>2015-04-16 13:47:44 +0200
committerZandra Hird <[email protected]>2015-05-05 16:40:36 +0200
commit098f7b59ef26c57f8b759c14a6f3757534d50175 (patch)
tree3538e08df937c4ede8ca3c61a0a905129455b2d2 /lib/inets/src/http_server
parent6e3e48d39a77aa18b92fb048d6a910baa71badf3 (diff)
downloadotp-098f7b59ef26c57f8b759c14a6f3757534d50175.tar.gz
otp-098f7b59ef26c57f8b759c14a6f3757534d50175.tar.bz2
otp-098f7b59ef26c57f8b759c14a6f3757534d50175.zip
make it possible to use a file to configure mime types
The documentation specifies that a file can be used to configure mime types, but currently it isn't working. With this change it works as documented.
Diffstat (limited to 'lib/inets/src/http_server')
-rw-r--r--lib/inets/src/http_server/httpd_conf.erl11
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/inets/src/http_server/httpd_conf.erl b/lib/inets/src/http_server/httpd_conf.erl
index 78dda794db..2cafed89f2 100644
--- a/lib/inets/src/http_server/httpd_conf.erl
+++ b/lib/inets/src/http_server/httpd_conf.erl
@@ -785,8 +785,15 @@ fix_mime_types(ConfigList0) ->
[{"html","text/html"},{"htm","text/html"}]}
| ConfigList0]
end;
- _ ->
- ConfigList0
+ MimeTypes ->
+ case filelib:is_file(MimeTypes) of
+ true ->
+ {ok, MimeTypesList} = load_mime_types(MimeTypes),
+ ConfigList = proplists:delete(mime_types, ConfigList0),
+ [{mime_types, MimeTypesList} | ConfigList];
+ false ->
+ ConfigList0
+ end
end.
store({mime_types,MimeTypesList},ConfigList) ->