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

feat: allow adding custom Vary to static assets header #2835

Open
wants to merge 4 commits into
base: v2
Choose a base branch
from

Conversation

daniluk4000
Copy link

πŸ”— Linked issue

Closes #2834

❓ Type of change

  • πŸ“– Documentation (updates to the documentation, readme, or JSdoc annotations)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

Allow to auto-extend Vary header if Accept-Encoding is passed from Nitro.

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@daniluk4000 daniluk4000 requested a review from pi0 as a code owner November 2, 2024 13:29
@daniluk4000 daniluk4000 changed the title feat: allow custom Vary header feat: allow custom static Vary header Nov 2, 2024
@pi0 pi0 changed the title feat: allow custom static Vary header feat: allow addinng custom Vary to static assets header Nov 2, 2024
@daniluk4000 daniluk4000 requested a review from pi0 November 4, 2024 12:30
@daniluk4000 daniluk4000 changed the title feat: allow addinng custom Vary to static assets header feat: allow adding custom Vary to static assets header Nov 4, 2024
@autofix-troubleshooter
Copy link

Hi! I'm the autofix logoautofix.ci troubleshooter bot.

It looks like you correctly set up a CI job that uses the autofix.ci GitHub Action, but the autofix.ci GitHub App has not been installed for this repository. This means that autofix.ci unfortunately does not have the permissions to fix this pull request. If you are the repository owner, please install the app and then restart the CI workflow! πŸ˜ƒ

@@ -310,6 +310,20 @@ export function testNitro(
expect(data).toMatch("<h1 >Hello JSX!</h1>");
});

it.skipIf(ctx.preset.startsWith('cloudflare') || ctx.preset === 'vercel-edge')(
Copy link
Member

Choose a reason for hiding this comment

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

Is the issue with this two diff in space? (we can normalize headers['vary'] to remove space)

Copy link
Author

Choose a reason for hiding this comment

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

Here I had something even different with Accept-Encoding not applying at all. I guess it depends on serve static param

Copy link
Member

@pi0 pi0 Nov 4, 2024

Choose a reason for hiding this comment

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

Ah right (when ctx.nitro.options.serveStatic is off we don't even use this)

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.

Allow adding custom vary header for static assets
3 participants