-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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: remove value and writable properties from headers descriptor #12552
Conversation
🦋 Changeset detectedLatest commit: 82a13d0 The changes in this PR will be included in the next version bump. 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 |
CodSpeed Performance ReportMerging #12552 will degrade performances by 35.68%Comparing Summary
Benchmarks breakdown
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for fixing this!
- Ensure that any existing value and writable properties are deleted from the headers descriptor before adding getters and setters. - This prevents error: `Invalid property descriptor. Cannot both specify accessors and a value or writable attribute, #<Object>`
f5041f1
to
82a13d0
Compare
@bluwy Hey, I just fixed a merge conflict by rebasing on Does it need a new approval now? 😅 |
No problem. LGTM! |
Thank you! 🙌🏻 |
Fixes #12548
Invalid property descriptor. Cannot both specify accessors and a value or writable attribute, #<Object>
Changes
value
andwritable
properties from theheaders
descriptor before defining getters and setters for theheaders
property on theRequest
object.Object.defineProperty
call to prevent theInvalid property descriptor
error during prerendering.request.headers
to allow updating_headers
if needed.Testing
This change was tested by building the Astro project with
prerender = true
and confirming that the build completes without theInvalid property descriptor
error.No automated tests have been added since this affects the internal build handling of the
Request
headers property, but manual testing confirms the fix.Docs
No documentation changes are needed for this fix, as this is an internal implementation detail that does not affect user-facing API or behavior directly.
/cc @withastro/maintainers-docs for feedback if required.