Skip to content
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

Write normalized scheme and host to routing.Route fields #2824

Merged
merged 1 commit into from
Jan 9, 2024

Conversation

RomanZavodskikh
Copy link
Contributor

@RomanZavodskikh RomanZavodskikh commented Jan 4, 2024

This change is needed for proxy to easily have normalized host and use it in endpointregistry for dynamic host-wide data to be easily fetchable.

This PR should make changes in #2823 easier.

@RomanZavodskikh RomanZavodskikh added the major moderate risk, for example new API, small filter changes that have no risk like refactoring or logs label Jan 4, 2024
net/net.go Outdated Show resolved Hide resolved
net/net.go Outdated Show resolved Hide resolved
net/net.go Outdated Show resolved Hide resolved
net/net_test.go Outdated Show resolved Hide resolved
net/net_test.go Outdated Show resolved Hide resolved
net/net_test.go Outdated Show resolved Hide resolved
net/net_test.go Outdated Show resolved Hide resolved
@RomanZavodskikh RomanZavodskikh force-pushed the normalizeSchemeHost branch 2 times, most recently from b62b0d9 to 01bfbd8 Compare January 5, 2024 16:21
@AlexanderYastrebov
Copy link
Member

👍

net/net.go Outdated Show resolved Hide resolved
net/net.go Outdated Show resolved Hide resolved
net/net.go Outdated Show resolved Hide resolved
net/net.go Outdated Show resolved Hide resolved
net/net.go Outdated Show resolved Hide resolved
@RomanZavodskikh RomanZavodskikh force-pushed the normalizeSchemeHost branch 3 times, most recently from 1dddb1d to 469d101 Compare January 5, 2024 18:04
@AlexanderYastrebov
Copy link
Member

👍

szuecs
szuecs previously requested changes Jan 5, 2024
net/net.go Outdated Show resolved Hide resolved
@szuecs
Copy link
Member

szuecs commented Jan 8, 2024

As discussed in person, can be a separate pr

net/net.go Outdated Show resolved Hide resolved
net/net.go Outdated Show resolved Hide resolved
net/net.go Outdated Show resolved Hide resolved
@szuecs szuecs dismissed their stale review January 8, 2024 17:37

talked in person

@AlexanderYastrebov
Copy link
Member

👍

net/net.go Outdated Show resolved Hide resolved
This change is needed for proxy to easily have normalized host and use it
in endpointregistry for dynamic host-wide data to be easily fetchable.

Signed-off-by: Roman Zavodskikh <roman.zavodskikh@zalando.de>
@AlexanderYastrebov
Copy link
Member

👍

2 similar comments
@RomanZavodskikh
Copy link
Contributor Author

👍

@szuecs
Copy link
Member

szuecs commented Jan 9, 2024

👍

@RomanZavodskikh RomanZavodskikh merged commit a7f049c into master Jan 9, 2024
14 checks passed
@RomanZavodskikh RomanZavodskikh deleted the normalizeSchemeHost branch January 9, 2024 10:27
}

// endpoint address cannot contain path, the rest is not case sensitive
s, h := strings.ToLower(u.Scheme), strings.ToLower(u.Host)
Copy link
Member

Choose a reason for hiding this comment

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

minor: I think variable names here could be more descriptive

scheme, host := strings.ToLower(u.Scheme), strings.ToLower(u.Host)
isolatedHost, port, err := net.SplitHostPort(h)

I feel like the current variable names is easy to forget and harder to debug later

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
major moderate risk, for example new API, small filter changes that have no risk like refactoring or logs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants