linzch3 opened a new pull request, #900: URL: https://github.com/apache/arrow-rs-object-store/pull/900
# Which issue does this PR close? Closes #454. # Rationale for this change The crate docs say that a custom `HttpConnector` can be used for things like "injecting custom HTTP headers", and #446 pointed users there, but there was no example of how to do it. # What changes are included in this PR? The "Customizing HTTP Clients" section in `src/lib.rs` now includes a doc example. It: - defines an `HttpService` that inserts a header and forwards the request to the `HttpClient` created by `ReqwestConnector` - defines an `HttpConnector` that builds it from the `ClientOptions` - registers it on an `AmazonS3Builder` with `with_http_connector` The example is gated on the `aws` feature, like the TLS example above it. It also adds a short note: the `HttpService` sees requests after they're signed, so injected headers aren't part of the signature, and S3 rejects unsigned `x-amz-*` headers. This is related to #708. # Are there any user-facing changes? Documentation only. Testing: - `cargo test --doc --features=aws,azure,gcp,http` passes, and the new example compiles and runs. - `RUSTDOCFLAGS=-Dwarnings cargo doc --document-private-items --no-deps --all-features` passes. - `cargo fmt --check` and `cargo clippy --features aws -- -D warnings` pass. - I also ran a throwaway test, not included in this PR, that pointed the example connector at a local TCP listener. The request arrived with `x-request-source: my-app`. --- I used an AI coding assistant to draft this change. I reviewed it and verified it locally as described above, following the Arrow / ASF guidance on AI-assisted contributions. -- 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]
