Skip to content
New issue

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

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

Already on GitHub? # to your account

fix: use custom merger for options to avoid array values concatenation #80

Merged

Conversation

Qrzy
Copy link

@Qrzy Qrzy commented Dec 29, 2022

Types of changes

  • Bug fix (a non-breaking change which fixes an issue)
  • New feature (a non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Description

As pointed in #78, defu (both used here and in Nuxt's code) was the reason of even triplicated values in the headers.
This PR aims fixing that by applying 2 changes:

  • removing defaults from module definition - so that Nuxt does not apply regular defu on defaults and options from the module user
  • creating custom merger with createDefu that in case of arrays replaces the value instead of concatenating them

Fixes #78

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes (if not applicable, please state why)

@vercel
Copy link

vercel bot commented Dec 29, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
nuxt-security ✅ Ready (Inspect) Visit Preview Dec 29, 2022 at 9:45AM (UTC)

@Baroshem
Copy link
Owner

Baroshem commented Jan 2, 2023

Works great! Merging.

@Baroshem Baroshem merged commit 2ecd741 into Baroshem:main Jan 2, 2023
@Qrzy Qrzy deleted the bugfix/multiplied-header-values-in-arrays branch January 2, 2023 11:13
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

adding custom configuration with array structure results in duplication of header values
2 participants