25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-20 16:15:59 +01:00

Try to redirect access to files mod_conversejs to cdn when there is no local copies

This commit is contained in:
Paweł Chmielowski 2022-11-23 16:28:42 +01:00
parent 514bab47a2
commit e2779e1155

View File

@ -117,7 +117,9 @@ is_served_file(_) -> false.
serve(Host, LocalPath) ->
case get_conversejs_resources(Host) of
undefined -> ejabberd_web:error(not_found);
undefined ->
Path = str:join(LocalPath, <<"/">>),
{303, [{<<"Location">>, <<"https://cdn.conversejs.org/dist/", Path/binary>>}], <<>>};
MainPath -> serve2(LocalPath, MainPath)
end.