✨ Allow setting client's API url via an environment variable#370
Merged
✨ Allow setting client's API url via an environment variable#370
Conversation
|
👍🏻 Thanks for putting this together @wwilsman |
samarsault
pushed a commit
that referenced
this pull request
Mar 3, 2023
Bumps @percy/sdk-utils from 1.0.0-beta.52 to 1.0.0-beta.56. --- updated-dependencies: - dependency-name: "@percy/sdk-utils" dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
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.
What is this?
In the world of
@percy/agent, setting thePERCY_APIenvironment variable allowed you to override the URL used by client to communicate with the Percy API. That behavior was lost when moving to the new@percy/cliworld, but can be useful when manually testing or interacting with a local development API.With client's proxy agent, we indiscriminately proxy all API requests through HTTPS since our production API server is guaranteed to be HTTPS. However, with the potential to change the API URL to a locally hosted URL, it might not always be HTTPS. So we need to check the protocol of the API URL to disable the HTTPS proxy agent and allow the
requestutil to default to the appropriate agent based on the request's protocol.This shouldn't be used by end users, so
PERCY_APIfelt too user friendly. I decided onPERCY_CLIENT_API_URL(to be hyper specific) but am open to changing it.