GayathriSrividya opened a new pull request, #3526:
URL: https://github.com/apache/iceberg-python/pull/3526
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
- /Users/gayathrir/Documents/airforce/iceberg-python/.venv/bin/python -m
pytest tests/io/test_fsspec.py -k 's3v4_rest_signer' -xvs
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]