Skip to content

Handle uppercase SVG favicons#918

Merged
dahlia merged 3 commits into
fedify-dev:2.0-maintenancefrom
junghoon-vans:fix/nodeinfo-uppercase-svg-favicon
Jul 5, 2026
Merged

Handle uppercase SVG favicons#918
dahlia merged 3 commits into
fedify-dev:2.0-maintenancefrom
junghoon-vans:fix/nodeinfo-uppercase-svg-favicon

Conversation

@junghoon-vans

@junghoon-vans junghoon-vans commented Jul 5, 2026

Copy link
Copy Markdown

Summary

  • Add regression coverage for uppercase .SVG favicon links, including query strings and fragments.
  • Parse favicon hrefs before checking the pathname so SVG icons are skipped reliably.
  • Add the required CHANGES.md entry.

Test plan

  • mise exec -- hongdown --check CHANGES.md
  • mise exec -- deno task -f @fedify/cli test --filter "getFaviconUrl"
  • mise run check-each cli

Closes #891

AI assistance disclosure: Hermes Agent helped prepare and verify the local change.

@netlify

netlify Bot commented Jul 5, 2026

Copy link
Copy Markdown

Deploy Preview for fedify-json-schema failed.

Name Link
🔨 Latest commit 9b8c093
🔍 Latest deploy log https://app.netlify.com/projects/fedify-json-schema/deploys/6a4a702291f9b10008d6af56

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request updates the getFaviconUrl function to handle uppercase .SVG extensions by converting the href attribute to lowercase before checking its suffix, and adds a corresponding test case. The reviewer suggested a robust improvement to parse the URL first and check the pathname to handle cases with query parameters or hash fragments (e.g., /icon.svg?v=1).

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread packages/cli/src/nodeinfo.ts
@coderabbitai

coderabbitai Bot commented Jul 5, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The getFaviconUrl function in nodeinfo.ts now parses href into a URL object and checks its pathname case-insensitively for a .svg suffix, replacing the prior case-sensitive string check on the raw href. Tests were added for uppercase SVG href variants.

Changes

SVG Favicon Fallback Fix

Layer / File(s) Summary
Case-insensitive SVG detection and coverage
packages/cli/src/nodeinfo.ts, packages/cli/src/nodeinfo.test.ts
getFaviconUrl parses href via new URL(attrs.href, response.url) and checks parsedUrl.pathname.toLowerCase().endsWith(".svg") instead of checking raw href; new tests verify uppercase .SVG hrefs (with and without query/hash) fall back to favicon.ico.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Possibly related issues

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The changes add the requested uppercase .SVG regression coverage and make getFaviconUrl fall back to /favicon.ico.
Out of Scope Changes check ✅ Passed No unrelated code changes stand out; the query/hash handling is consistent with the SVG favicon fix.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed The title clearly and concisely summarizes the main change: handling uppercase SVG favicons.
Description check ✅ Passed The description is directly related to the changeset and accurately describes the test coverage, parsing fix, and related workflow.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Jul 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

Files with missing lines Coverage Δ
packages/cli/src/nodeinfo.ts 45.63% <100.00%> (+0.13%) ⬆️

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@dahlia dahlia left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for your contribution. However, since it's a bug fix, it should target 2.0-maintenance instead of main. Please read our CONTRIBUTING.md first.

Check the parsed favicon URL pathname before deciding whether an icon is SVG.  This keeps query strings and fragments from hiding SVG favicon paths.

Assisted-by: Hermes Agent:gpt-5.5
@junghoon-vans junghoon-vans force-pushed the fix/nodeinfo-uppercase-svg-favicon branch from 6a225bb to 9b8c093 Compare July 5, 2026 14:54
@junghoon-vans junghoon-vans changed the base branch from main to 2.0-maintenance July 5, 2026 14:54
@junghoon-vans

junghoon-vans commented Jul 5, 2026

Copy link
Copy Markdown
Author

@dahlia Thanks for the review. I've rebased the branch onto 2.0-maintenance and retargeted the PR.

@dahlia dahlia left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Could you add a changelog entry to CHANGES.md? Don't miss adding your credit as well.

Add the required changelog entry for the nodeinfo SVG favicon fallback bug fix.

Assisted-by: Hermes Agent:gpt-5.5
@junghoon-vans

Copy link
Copy Markdown
Author

@dahlia Thanks again—I've also added the required CHANGES.md entry with the issue number, PR number, and contributor name.

@dahlia dahlia left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for your first contribution!

@dahlia dahlia merged commit ab7f167 into fedify-dev:2.0-maintenance Jul 5, 2026
17 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.

Test uppercase SVG favicon fallback in fedify nodeinfo

2 participants