Skip to content

fix: update CDN asset links to relative paths#454

Merged
hsluoyz merged 3 commits intoapache:masterfrom
sagilio:hotfix/cdn_file
Mar 25, 2026
Merged

fix: update CDN asset links to relative paths#454
hsluoyz merged 3 commits intoapache:masterfrom
sagilio:hotfix/cdn_file

Conversation

@sagilio
Copy link
Copy Markdown
Member

@sagilio sagilio commented Mar 24, 2026

The existing CDN resources on the current page (https://cdn.casbin.org/) are currently blocked by Apache.org's CORS policy. Since Apache.org itself already leverages a CDN, hosting these resources separately may be redundant. Therefore, we should switch to relative paths and bundle these assets with the rest of our resources.
image

Asset path updates:

  • Updated all language icon URLs in the languages array in src/components/LanguageIntegration/index.js to use local /img/langs/ paths instead of external CDN links.
  • Updated the language icon mappings in src/utils/languageIconMapping.ts to use local /img/langs/ paths rather than CDN URLs.
  • Changed the background video source in the HomepageHeader component (src/pages/index.js) to use the local /video/background.mp4 file instead of the CDN version.

Copilot AI review requested due to automatic review settings March 24, 2026 14:27
@sagilio sagilio self-assigned this Mar 24, 2026
@sagilio sagilio requested a review from hsluoyz March 24, 2026 14:28
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR removes reliance on cdn.casbin.org for homepage language icons and the header background video by switching to locally hosted static assets, avoiding Apache.org CORS issues and redundant external hosting.

Changes:

  • Replace CDN language icon URLs with local /img/langs/* paths in the LanguageIntegration component.
  • Replace CDN language icon URLs with local /img/langs/* paths in the languageIconMapping utility.
  • Replace the homepage header background video CDN URL with local /video/background.mp4.

Reviewed changes

Copilot reviewed 3 out of 21 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
static/img/langs/swift-15.svg Add local Swift icon asset
static/img/langs/rust.svg Add local Rust icon asset
static/img/langs/ruby.svg Add local Ruby icon asset
static/img/langs/python-5.svg Add local Python icon asset
static/img/langs/nodejs-1.svg Add local Node.js icon asset
static/img/langs/lua-5.svg Add local Lua icon asset
static/img/langs/logo-javascript.svg Add local JavaScript icon asset
static/img/langs/laravel-2.svg Add local Laravel icon asset
static/img/langs/kubernets.svg Add local Kubernetes/Cloud Native icon asset
static/img/langs/jee-3.svg Add local Java icon asset
static/img/langs/go-logo-1.svg Add local Go icon asset
static/img/langs/elixir-lang-icon.svg Add local Elixir icon asset
static/img/langs/dotnet-logo.svg Add local .NET icon asset
static/img/langs/delphi-2.svg Add local Delphi icon asset
static/img/langs/dart.svg Add local Dart icon asset
static/img/langs/c.svg Add local C/C++ icon asset
static/img/langs/PHP-logo.svg Add local PHP icon asset
src/utils/languageIconMapping.ts Point language name → icon mapping to local /img/langs/* paths
src/pages/index.js Point homepage header video source to local /video/background.mp4
src/components/LanguageIntegration/index.js Point language carousel icons to local /img/langs/* paths

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

hsluoyz and others added 2 commits March 25, 2026 20:05
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@hsluoyz hsluoyz changed the title fix: update CDN asset links to relative paths in index.js fix: update CDN asset links to relative paths Mar 25, 2026
@hsluoyz hsluoyz merged commit b48c110 into apache:master Mar 25, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants