-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[v2] Add configuration to disable host prefix injection #9268
base: v2
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"type": "feature", | ||
"category": "configuration", | ||
"description": "Configure if the host prefix is prepended to the request URL in the shared configuration file or via an environment variable" | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -212,7 +212,6 @@ def compute_client_args(self, service_model, client_config, | |
proxies_config=client_config.proxies_config, | ||
retries=client_config.retries, | ||
client_cert=client_config.client_cert, | ||
inject_host_prefix=client_config.inject_host_prefix, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we should leave this in here and when we compute the value, we can check if this is not There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sure, not opposed to this. I went for self-containing all of the logic in the |
||
request_min_compression_size_bytes=( | ||
client_config.request_min_compression_size_bytes | ||
), | ||
|
@@ -236,6 +235,8 @@ def compute_client_args(self, service_model, client_config, | |
self._compute_user_agent_appid_config(config_kwargs) | ||
self._compute_sigv4a_signing_region_set_config(config_kwargs) | ||
self._compute_checksum_config(config_kwargs) | ||
self._compute_inject_host_prefix(client_config, config_kwargs) | ||
|
||
s3_config = self.compute_s3_config(client_config) | ||
|
||
is_s3_service = self._is_s3_service(service_name) | ||
|
@@ -256,6 +257,24 @@ def compute_client_args(self, service_model, client_config, | |
'socket_options': self._compute_socket_options(scoped_config) | ||
} | ||
|
||
def _compute_inject_host_prefix(self, client_config, config_kwargs): | ||
if client_config is not None and client_config.inject_host_prefix is not None: | ||
config_kwargs['inject_host_prefix'] = ( | ||
client_config.inject_host_prefix | ||
) | ||
Comment on lines
+260
to
+264
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So here we can remove
|
||
else: | ||
configured_disable_host_prefix_injection = ( | ||
self._config_store.get_config_variable( | ||
'disable_host_prefix_injection' | ||
) | ||
) | ||
if configured_disable_host_prefix_injection is not None: | ||
config_kwargs[ | ||
'inject_host_prefix' | ||
] = not configured_disable_host_prefix_injection | ||
else: | ||
config_kwargs['inject_host_prefix'] = True | ||
|
||
def _compute_configured_endpoint_url(self, client_config, endpoint_url): | ||
if endpoint_url is not None: | ||
return endpoint_url | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we document the specific environment variable and setting name here?