Looking in Gitlab the path to the avatar is /github-mirror/mod_bgithub_feed/-/avatar whereas a manually set avatar tends to be /uploads/-/system/project/avatar/30/eagle_black_large_trans.png
So, we need to look at handling for that - the most important thing is not showing broken images, so we either need to disable avatars of that form or we need to be able to display them.
Displaying them is liable to cause some headaches though. It'll work fine when GILS is accessed directly (because we can pass the Content-Type header through), but if it's viewed via a wget mirror it's likely to upset some browsers - with no file extension it'll likely get served as application/octet-stream and not display.
I guess though, the bulk of the work is detecting the URLs in the first place - rewriting them for proxying through shouldn't be too much effort, so we can try and see how a static mirror fares.
As Avatar URLs are constructed in a dedicated function (rather than the main SEF ones), we could try and figure out the filename extension by making an API call for the object and checking it's content type header.
We probably do want to be thinking more about API request caching now though, as this has just introduced an additional per-avatar request for any page displaying avatars drawn from repo metadata.
Activity
21-Apr-22 07:38
assigned to @btasker
21-Apr-22 07:46
The anchor has ended up as
Looking in Gitlab the path to the avatar is
/github-mirror/mod_bgithub_feed/-/avatar
whereas a manually set avatar tends to be/uploads/-/system/project/avatar/30/eagle_black_large_trans.png
So, we need to look at handling for that - the most important thing is not showing broken images, so we either need to disable avatars of that form or we need to be able to display them.
Displaying them is liable to cause some headaches though. It'll work fine when GILS is accessed directly (because we can pass the
Content-Type
header through), but if it's viewed via awget
mirror it's likely to upset some browsers - with no file extension it'll likely get served asapplication/octet-stream
and not display.I guess though, the bulk of the work is detecting the URLs in the first place - rewriting them for proxying through shouldn't be too much effort, so we can try and see how a static mirror fares.
21-Apr-22 07:55
mentioned in commit 582e0eab6563236bc0883c6b8daba793483f5426
Message
Construct a different avatar path where the avatar is being pulled from repo metadata. See websites/Gitlab-Issue-Listing-Script#31
21-Apr-22 08:00
mentioned in commit 1aebbaf48550852b8ccc7154fd1d7ccd9f52e8a9
Message
Add router side support for avatars served from repo metadata - websites/Gitlab-Issue-Listing-Script#31
21-Apr-22 08:01
The functionality is in place and working.
As Avatar URLs are constructed in a dedicated function (rather than the main SEF ones), we could try and figure out the filename extension by making an API call for the object and checking it's content type header.
That'd work around the mirroring issues
21-Apr-22 08:18
mentioned in commit 088a5f006cf91d6615031e842d38509b797f1320
Message
Introduce an API call so we can use the correct filename extension websites/Gitlab-Issue-Listing-Script#31
21-Apr-22 08:19
This is in place.
We probably do want to be thinking more about API request caching now though, as this has just introduced an additional per-avatar request for any page displaying avatars drawn from repo metadata.