fix(next/image): fix image-optimizer.ts headers (#82114)#2
fix(next/image): fix image-optimizer.ts headers (#82114)#2MitchLewis930 wants to merge 1 commit intopr_032_beforefrom
Conversation
The headers were forwarded to the serverless function for "internal" images but not "external" images. This changes the behavior to be the same for both such that neither receive headers.
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
|||||||||||||||||||||||
PR Code Suggestions ✨Explore these optional code suggestions:
|
|||||||||
User description
PR_032
PR Type
Bug fix
Description
Remove headers forwarding from internal image requests
Ensure consistent behavior between internal and external images
Add test to verify cookie headers are not forwarded
Diagram Walkthrough
File Walkthrough
image-optimizer.ts
Remove headers forwarding from internal imagespackages/next/src/server/image-optimizer.ts
headers: _req.headersfromcreateRequestResponseMockscall infetchInternalImagefunctionutil.ts
Add test for cookie header non-forwardingtest/integration/image-optimizer/test/util.ts
should not forward cookie headerforwarded
conditional-cookie.js
Add conditional cookie test endpointtest/integration/image-optimizer/app/pages/api/conditional-cookie.js