Rename config setting + Disable compression by default#34
Conversation
| /// | ||
| /// Removes unwanted headers from the given request | ||
| pub(crate) fn strip_headers(request: &mut Request) { | ||
| pub(crate) fn strip_request_from_headers(request: &mut Request) { |
There was a problem hiding this comment.
🔧 The order is wrong. See the examples I found:
Example: "I need to strip the old paint from the cabinet."
Example: "The wind stripped the leaves from the trees."
f64fdfd to
38a9a2b
Compare
m-szymon
left a comment
There was a problem hiding this comment.
Following other drivers we should call it optimize_headers (and headers_whitelist when we can customize the whitelist).
| pub fn enforce_header_whitelist(&self) -> Option<bool> { | ||
| self.alternator_ext.enforce_header_whitelist |
There was a problem hiding this comment.
I think we should be consistent with other drivers:
| Driver | Option name | Custom whitelist |
|---|---|---|
| Java | withOptimizeHeaders(true) |
withHeadersWhitelist(List) |
| Python | optimize_headers=True |
headers_whitelist=frozenset |
| Go | WithOptimizeHeaders(true) |
N/A |
|
Please, resolve conflicts. |
Following the change in scylladb#34
| } | ||
|
|
||
| /// Before sending each request, strip them from headers that are not used by the Alternator. | ||
| /// Before sending each request, strip the headers from them which are not used by the Alternator. |
| } | ||
|
|
||
| /// Before sending each request, strip them from headers that are not used by the Alternator. | ||
| /// Before sending each request, strip the headers from them which are not used by the Alternator. |
| } | ||
|
|
||
| /// Before sending each request, strip them from headers that are not used by the Alternator. | ||
| /// Before sending each request, strip the headers from them which are not used by the Alternator. |
| pub fn optimize_headers(&self) -> Option<bool> { | ||
| self.alternator_ext.optimize_headers | ||
| } |
| /// - chooses an arbitrary aws region, as alternator doesn't require one | ||
| /// - does not use request compression | ||
| /// | ||
| /// Can be build using [AlternatorConfig] like so: |
There was a problem hiding this comment.
Please take a look at correctness of comments.
E.g. the module-level comment at the top (tests/http_content/optimize_headers.rs:1-33) still has several grammar/style issues, for example:
follow specific header whitelisttherefore we in fact, need to strip themfirst 3 use the same set of driver calls
| /// By default: | ||
| /// - enables round-robin load balancing | ||
| /// - strips headers that are not used by the alternator from all requests | ||
| /// - chooses an arbitrary aws region, as alternator doesn't require one |
There was a problem hiding this comment.
This wording is a bit misleading. The client does not choose an arbitrary region; it sets a concrete default region. I would phrase this as "sets a default AWS region" instead.
Client should disable request compression by default, as older Scylla versions do not support request compression.
Also,
enforce_header_whitelistconfig setting can be simplified tostrip_headers.