mirror of
https://github.com/processone/ejabberd
synced 2025-10-03 17:59:31 +02:00
Try to redirect access to files mod_conversejs to cdn when there is no local copies
This commit is contained in:
parent
514bab47a2
commit
e2779e1155
1 changed files with 3 additions and 1 deletions
|
@ -117,7 +117,9 @@ is_served_file(_) -> false.
|
||||||
|
|
||||||
serve(Host, LocalPath) ->
|
serve(Host, LocalPath) ->
|
||||||
case get_conversejs_resources(Host) of
|
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)
|
MainPath -> serve2(LocalPath, MainPath)
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue