Repository navigation
Resolve host prefix injection setting from env/config - #7496
Open
alextwoods wants to merge 2 commits into
Open
alextwoods wants to merge 2 commits into
alextwoods wants to merge 2 commits into
Conversation
## Motivation The `DISABLE_HOST_PREFIX_INJECTION` advanced option could only be set in code, and the AWS client builder set it to false whenever the caller left it unset. The SDK read no system property, environment variable or profile setting for it. A user who started the JVM with `-Daws.disableHostPrefixInjection=true` still had requests sent to the prefixed host, such as `data-servicediscovery.us-east-1.amazonaws.com`. ## Changes 1. Clients now resolve the option at build time when the caller has not set it in code, from the `aws.disableHostPrefixInjection` system property, then the `AWS_DISABLE_HOST_PREFIX_INJECTION` environment variable, then the `disable_host_prefix_injection` profile property, and then false. 2. The AWS client builder no longer forces the option to false, which blocked this resolution. 3. A value set in code through `overrideConfiguration` still takes precedence over all three sources. 4. The option's javadoc lists the sources and their order, and a changelog entry announces the feature.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
The
DISABLE_HOST_PREFIX_INJECTIONadvanced option could only be set in code, and the AWS client builder set it to false whenever the caller left it unset. The SDK read no system property, environment variable or profile setting for it. Those are supported by the CLI and Boto3.Changes
aws.disableHostPrefixInjectionsystem property, then theAWS_DISABLE_HOST_PREFIX_INJECTIONenvironment variable, then thedisable_host_prefix_injectionprofile property, and then false.overrideConfigurationstill takes precedence over all three sources.Types of changes
License