Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(assets): check if favicon.ico is a file #633

Merged
merged 1 commit into from
Nov 19, 2024

Conversation

chanceaclark
Copy link
Contributor

What/why?

In the case a Next.js application has a route handler for the favicon.ico path, we need to check to see if it's a file before copying it over to the output directory.

Example:

// /app/favicon.ico/route.ts
export const GET = async () => {
  const favicon = await fetch('https://somecms.com').then((res) => res.arrayBuffer());

  return new Response(favicon, {
    headers: {
      'Content-Type': 'image/x-icon',
    },
  });
};

export const dynamic = 'force-static';

Copy link

changeset-bot bot commented Nov 18, 2024

🦋 Changeset detected

Latest commit: e99dfe8

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@opennextjs/aws Patch
app-pages-router Patch
app-router Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Contributor

@khuezy khuezy left a comment

Choose a reason for hiding this comment

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

LGTM thanks!

Copy link

pkg-pr-new bot commented Nov 18, 2024

Open in Stackblitz

pnpm add https://pkg.pr.new/@opennextjs/aws@633

commit: e99dfe8

@vicb vicb merged commit ba84259 into opennextjs:main Nov 19, 2024
3 checks passed
@github-actions github-actions bot mentioned this pull request Nov 14, 2024
@chanceaclark chanceaclark deleted the fix/favicon-asset branch November 19, 2024 14:48
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