1
0
Fork 0
mirror of https://github.com/processone/ejabberd synced 2025-10-03 09:49:18 +02: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.