diff options
author | Ingela Anderton Andin <[email protected]> | 2010-12-01 10:24:51 +0100 |
---|---|---|
committer | Ingela Anderton Andin <[email protected]> | 2010-12-01 10:24:51 +0100 |
commit | 7369151bc24d9d3b0b1ebed19a1a7d0df9101a81 (patch) | |
tree | b34ce11c1aa8ee57d363983d1f8d382ea3a7b64a /lib/inets/src/http_server/httpd_file.erl | |
parent | d9a508b6ca18ce3bf76563c89bf452e74fa65d45 (diff) | |
parent | f05d42599f3c8fa3632ca04c21a5f91100275feb (diff) | |
download | otp-7369151bc24d9d3b0b1ebed19a1a7d0df9101a81.tar.gz otp-7369151bc24d9d3b0b1ebed19a1a7d0df9101a81.tar.bz2 otp-7369151bc24d9d3b0b1ebed19a1a7d0df9101a81.zip |
Merge branch 'ia/inets/url-encoding/OTP-8940' into dev
* ia/inets/url-encoding/OTP-8940:
Changed file error handling to be consistent
URL-encoding - add support in client and more usage in server. Also added missing include directory.
Diffstat (limited to 'lib/inets/src/http_server/httpd_file.erl')
-rw-r--r-- | lib/inets/src/http_server/httpd_file.erl | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/inets/src/http_server/httpd_file.erl b/lib/inets/src/http_server/httpd_file.erl index 5fd529100e..7e21d9e158 100644 --- a/lib/inets/src/http_server/httpd_file.erl +++ b/lib/inets/src/http_server/httpd_file.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2006-2009. All Rights Reserved. +%% Copyright Ericsson AB 2006-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -22,11 +22,13 @@ -export([handle_error/4]). -include("httpd.hrl"). +-include("httpd_internal.hrl"). + handle_error(eacces, Op, ModData, Path) -> - handle_error(403, Op, ModData, Path,""); + handle_error(403, Op, ModData, Path,"Forbidden"); handle_error(enoent, Op, ModData, Path) -> - handle_error(404, Op, ModData, Path,""); + handle_error(404, Op, ModData, Path,"File not found"); handle_error(enotdir, Op, ModData, Path) -> handle_error(404, Op, ModData, Path, ": A component of the file name is not a directory"); @@ -34,8 +36,8 @@ handle_error(emfile, Op, _ModData, Path) -> handle_error(500, Op, none, Path, ": To many open files"); handle_error({enfile,_}, Op, _ModData, Path) -> handle_error(500, Op, none, Path, ": File table overflow"); -handle_error(_Reason, Op, _ModData, Path) -> - handle_error(500, Op, none, Path, ""). +handle_error(_Reason, Op, ModData, Path) -> + handle_error(404, Op, ModData, Path, "File not found"). handle_error(StatusCode, Op, none, Path, Reason) -> {StatusCode, none, ?NICE("Can't " ++ Op ++ Path ++ Reason)}; |