aboutsummaryrefslogtreecommitdiffstats
path: root/lib/inets/src
diff options
context:
space:
mode:
authorZandra Hird <[email protected]>2015-05-11 14:47:59 +0200
committerZandra Hird <[email protected]>2015-05-11 14:47:59 +0200
commit1f9201ca7db28e19e92c094b0317230ee930829c (patch)
tree19547de92bc874b9645a0901b51fe2cd6b8babe2 /lib/inets/src
parentb5ed0f90e7a57c5c51e32f58ed217e87aad7112d (diff)
parent098f7b59ef26c57f8b759c14a6f3757534d50175 (diff)
downloadotp-1f9201ca7db28e19e92c094b0317230ee930829c.tar.gz
otp-1f9201ca7db28e19e92c094b0317230ee930829c.tar.bz2
otp-1f9201ca7db28e19e92c094b0317230ee930829c.zip
Merge branch 'zandra/mime-types-config/OTP-12731'
* zandra/mime-types-config/OTP-12731: make it possible to use a file to configure mime types
Diffstat (limited to 'lib/inets/src')
-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 dbdc1be272..a21eb915d4 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) ->