Skip to content

Conversation

@rahul2393
Copy link
Collaborator

Fixes: #459

@rahul2393 rahul2393 requested a review from a team as a code owner July 1, 2025 18:52
@rahul2393 rahul2393 requested a review from olavloite July 1, 2025 18:52
if connectorConfig.Host == "" {
connectorConfig.Host = "localhost:9010"
}
schemeRemoved := regexp.MustCompile("^(http://|https://|passthrough:///)").ReplaceAllString(connectorConfig.Host, "")
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I should like to use url.Parse then update the url scheme instead.

Copy link
Collaborator Author

@rahul2393 rahul2393 Jul 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was written to be consistent with the client library https://github.com/search?q=repo%3Agoogleapis%2Fgoogle-cloud-go%20%5E(http%3A%2F%2F%7Chttps%3A%2F%2F%7Cpassthrough%3A%2F%2F%2F&type=code

Can you please share any specific test where we need to check scheme from url.Parse instead of just replacing?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nvm, replacing using url.Parse is more safe with the URL, also handle the case sensitive. But if other places using the same approach, keep it consistent

@rahul2393 rahul2393 merged commit a518727 into main Jul 2, 2025
20 checks passed
@rahul2393 rahul2393 deleted the issue-459 branch July 2, 2025 02:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

driver: the driver shouldn't touch the application enviroment variables

4 participants