]> granicus.if.org Git - ejabberd/commitdiff
If local guide.html file not found, redirect to the online guide
authorBadlop <badlop@process-one.net>
Wed, 15 Jul 2015 18:45:55 +0000 (20:45 +0200)
committerBadlop <badlop@process-one.net>
Wed, 15 Jul 2015 18:45:55 +0000 (20:45 +0200)
src/ejabberd_web_admin.erl

index 7f2bd81e44247980381a1b1774bb4c0332a39ee5..4ff80ecedc167cecf52aa29b2f789df008dc481a 100644 (file)
@@ -167,15 +167,15 @@ process([<<"doc">>, LocalFile], _Request) ->
          ?DEBUG("Delivering content.", []),
          {200, [{<<"Server">>, <<"ejabberd">>}], FileContents};
       {error, Error} ->
-         ?DEBUG("Delivering error: ~p", [Error]),
          Help = <<" ", FileName/binary,
                   " - Try to specify the path to ejabberd "
                   "documentation with the environment variable "
                   "EJABBERD_DOC_PATH. Check the ejabberd "
                   "Guide for more information.">>,
+         ?INFO_MSG("Problem '~p' accessing the local Guide file ~s", [Error, Help]),
          case Error of
            eacces -> {403, [], <<"Forbidden", Help/binary>>};
-           enoent -> {404, [], <<"Not found", Help/binary>>};
+           enoent -> {307, [{<<"Location">>, <<"http://docs.ejabberd.im/admin/guide/configuration/">>}], <<"Not found", Help/binary>>};
            _Else ->
                {404, [], <<(iolist_to_binary(atom_to_list(Error)))/binary, Help/binary>>}
          end