Skip to content

fix: ignore Expect header in S3 REST signer payload#3526

Open
GayathriSrividya wants to merge 1 commit into
apache:mainfrom
GayathriSrividya:fix/issue-3291-s3-rest-signer-expect-header
Open

fix: ignore Expect header in S3 REST signer payload#3526
GayathriSrividya wants to merge 1 commit into
apache:mainfrom
GayathriSrividya:fix/issue-3291-s3-rest-signer-expect-header

Conversation

@GayathriSrividya

@GayathriSrividya GayathriSrividya commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

closes #3291

Summary

  • Strip the Expect header from S3 requests before calling the REST signing service.
  • Prevent Expect: 100-continue from being included in the signing payload and signed headers.
  • Add a regression test that verifies Expect is not forwarded to the signer service.

Root cause

The S3 REST signer forwarded all request headers to the signer endpoint. Some S3-compatible signing services reject signing payloads that include Expect: 100-continue, resulting in SignError with HTTP 412.

Changes

  • In pyiceberg/io/fsspec.py:
    • Remove any Expect header before constructing signer request payload in S3V4RestSigner.call.
  • In tests/io/test_fsspec.py:
    • Add test_s3v4_rest_signer_strips_expect_header to validate Expect is removed from both the signer payload and request headers.

Validation

  • /opt/homebrew/bin/ruff format pyiceberg/io/fsspec.py tests/io/test_fsspec.py
  • /opt/homebrew/bin/ruff check --fix pyiceberg/io/fsspec.py tests/io/test_fsspec.py
  • /path/.venv/bin/python -m pytest tests/io/test_fsspec.py -k 's3v4_rest_signer' -xvs

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.

Failed to sign request 412 - Expect: ['100-continue']

1 participant