Skip to content

Fix fetch failed due to unsupported expect header#2906

Closed
rinatkhaziev wants to merge 1 commit into
trunkfrom
fix/unidici-fun
Closed

Fix fetch failed due to unsupported expect header#2906
rinatkhaziev wants to merge 1 commit into
trunkfrom
fix/unidici-fun

Conversation

@rinatkhaziev

Copy link
Copy Markdown
Contributor

This pull request adds a new utility to strip unsupported HTTP headers (specifically the Expect header) from requests made to S3, and introduces a test to verify this behavior in the uploadImportFileToS3 function. This ensures better compatibility with the undici HTTP client and S3 presigned URLs.

Testing and Bug Fixes:

  • Added a test for uploadImportFileToS3 in __tests__/lib/client-file-uploader.js to verify that unsupported Expect headers are stripped from presigned S3 uploads.
  • Imported uploadImportFileToS3 into the test file to enable testing of the new behavior.

HTTP Header Handling Improvements:

  • Added the stripUndiciUnsupportedHeaders utility to remove unsupported headers (like Expect) from HTTP requests before sending them with undici.
  • Updated fetchWithRetry to use stripUndiciUnsupportedHeaders on all outgoing requests, improving compatibility and preventing errors with S3 and the undici client.
  • Included the Headers class from undici to support header manipulation.

Pull request checklist

New release checklist

Steps to Test

Outline the steps to test and verify the PR here.

Example:

  1. Check out PR.
  2. Run npm run build
  3. Run ./dist/bin/vip-cookies.js nom
  4. Verify cookies are delicious.

@github-actions

Copy link
Copy Markdown
Contributor

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@rinatkhaziev

Copy link
Copy Markdown
Contributor Author

superseded by #2905

@rinatkhaziev rinatkhaziev deleted the fix/unidici-fun branch June 23, 2026 01:28
@sonarqubecloud

Copy link
Copy Markdown

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.

1 participant