aboutsummaryrefslogtreecommitdiffstats
path: root/lib/inets/src/http_server
diff options
context:
space:
mode:
authorIngela Anderton Andin <[email protected]>2016-06-07 16:23:48 +0200
committerIngela Anderton Andin <[email protected]>2016-06-09 17:09:11 +0200
commit7457930c63725776a57f3b1fbc002dbc48384f81 (patch)
tree18cec58a8e9190b493d964318214666c1ae2d475 /lib/inets/src/http_server
parent1ab69efa960703b86a13ea6ba96f4fd56f1565f9 (diff)
downloadotp-7457930c63725776a57f3b1fbc002dbc48384f81.tar.gz
otp-7457930c63725776a57f3b1fbc002dbc48384f81.tar.bz2
otp-7457930c63725776a57f3b1fbc002dbc48384f81.zip
inets: Handle multiple \t in mime types file
Diffstat (limited to 'lib/inets/src/http_server')
-rw-r--r--lib/inets/src/http_server/httpd_conf.erl7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/inets/src/http_server/httpd_conf.erl b/lib/inets/src/http_server/httpd_conf.erl
index a7783bc1e9..132e1b5b7a 100644
--- a/lib/inets/src/http_server/httpd_conf.erl
+++ b/lib/inets/src/http_server/httpd_conf.erl
@@ -1004,7 +1004,8 @@ read_config_file(Stream, SoFar) ->
%% Ignore commented lines for efficiency later ..
read_config_file(Stream, SoFar);
Line ->
- NewLine = re:replace(clean(Line),"[\t\r\f ]"," ", [{return,list}]),
+ NewLine = re:replace(white_space_clean(Line),
+ "[\t\r\f ]"," ", [{return,list}, global]),
case NewLine of
[] ->
%% Also ignore empty lines ..
@@ -1020,7 +1021,7 @@ parse_mime_types(Stream,MimeTypesList) ->
eof ->
eof;
String ->
- white_space_clean(String)
+ re:replace(white_space_clean(String), "[\t\r\f ]"," ", [{return,list}, global])
end,
parse_mime_types(Stream, MimeTypesList, Line).
parse_mime_types(Stream, MimeTypesList, eof) ->
@@ -1042,6 +1043,8 @@ parse_mime_types(Stream, MimeTypesList, Line) ->
suffixes(_MimeType,[]) ->
[];
+suffixes(MimeType,[""|Rest]) ->
+ suffixes(MimeType, Rest);
suffixes(MimeType,[Suffix|Rest]) ->
[{Suffix,MimeType}|suffixes(MimeType,Rest)].