7
0
mirror of https://github.com/ChristianLight/tutor.git synced 2024-06-01 05:40:48 +00:00

fix: display themed favicon across all apps

Previously, we were redirecting all /*favicon.ico requests to the default
favicon. This meant that the favicon might not necessarily be correctly themed,
most notably in MFEs. Here, we resolve this issue by redirecting to the
theme-agnostic theming/asset/* url. Also, we restrict the overly generic regexp
for favicon url matching. We verified that we did not miss any url by running
the following command on the demo server:

    tutor local logs caddy | grep --only-matching "host.*favicon.ico" | sort | uniq
This commit is contained in:
Régis Behmo 2022-01-20 14:29:00 +01:00 committed by Régis Behmo
parent acc0ce0202
commit 1172ab6f1f
2 changed files with 5 additions and 4 deletions

View File

@ -4,6 +4,7 @@ Note: Breaking changes between versions are indicated by "💥".
## Unreleased
- [Bugfix] Display properly themed favicon.ico image in LMS, Studio and microfrontends.
- [Bugfix] Fix "LazyStaticAbsoluteUrl is not JSON serializable" error when sending bulk emails.
- [Bugfix] Fix `tutor local importdemocourse` fails when platform is not up.

View File

@ -27,9 +27,9 @@
{{ LMS_HOST }}{$default_site_port}, {{ PREVIEW_LMS_HOST }}{$default_site_port} {
@favicon_matcher {
path_regexp ^(.*)/favicon.ico$
path_regexp ^/favicon.ico$
}
rewrite @favicon_matcher /static/images/favicon.ico
rewrite @favicon_matcher /theming/asset/images/favicon.ico
# Limit profile image upload size
request_body /api/profile_images/*/*/upload {
@ -46,9 +46,9 @@
{{ CMS_HOST }}{$default_site_port} {
@favicon_matcher {
path_regexp ^(.*)/favicon.ico$
path_regexp ^/favicon.ico$
}
rewrite @favicon_matcher /static/images/favicon.ico
rewrite @favicon_matcher /theming/asset/images/favicon.ico
request_body {
max_size 250MB