Skip to content

Commit

Permalink
fix: mastodon s3 link
Browse files Browse the repository at this point in the history
  • Loading branch information
eallion committed Oct 20, 2024
1 parent 41e666c commit c950fe0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions layouts/_default/mastodon.html
Original file line number Diff line number Diff line change
@@ -200,7 +200,7 @@ <h1 class="mt-0 text-4xl font-extrabold text-neutral-900 dark:text-neutral">
const response = await originalFetch(resource, options);

// 检查请求的 URL
if (resource.includes('https://files.e5n.cc.eallion.com/accounts/avatars/')) {
if (resource.includes('https://files.e5n.cc/accounts/avatars/')) {
// 创建一个新的响应,返回 /eallion.webp
const newResponse = new Response(null, {
status: 302,
@@ -248,7 +248,7 @@ <h1 class="mt-0 text-4xl font-extrabold text-neutral-900 dark:text-neutral">
const images = document.querySelectorAll('img');
images.forEach(img => {
const src = img.getAttribute('src');
if (src && src.includes('https://files.e5n.cc.eallion.com/accounts/avatars/')) {
if (src && src.includes('https://files.e5n.cc/accounts/avatars/')) {
img.setAttribute('src', '/eallion.webp');
img.setAttribute('data-original-src', src); // 添加调试信息
}

0 comments on commit c950fe0

Please sign in to comment.