Skip to content

fix: Split host and port before storing IP #2594

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

Merged
merged 2 commits into from
Jun 26, 2022
Merged

fix: Split host and port before storing IP #2594

merged 2 commits into from
Jun 26, 2022

Conversation

kylecarbs
Copy link
Member

The IP was always nil prior, and this fixes the test to
check for that as well!

The IP was always nil prior, and this fixes the test to
check for that as well!
@kylecarbs kylecarbs requested a review from deansheather June 22, 2022 19:28
@kylecarbs kylecarbs self-assigned this Jun 22, 2022
@kylecarbs kylecarbs enabled auto-merge (squash) June 22, 2022 19:30
@@ -435,7 +436,7 @@ func TestAPIKey(t *testing.T) {
gotAPIKey, err := db.GetAPIKeyByID(r.Context(), id)
require.NoError(t, err)

require.NotEqual(t, sentAPIKey.IPAddress, gotAPIKey.IPAddress)
require.Equal(t, net.ParseIP("1.1.1.1"), gotAPIKey.IPAddress.IPNet.IP)
Copy link
Contributor

Choose a reason for hiding this comment

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

noob question: I see you added :3555 on L417 but then here on L439, you're passing in "1.1.1.1. So why add the :3555 if we're not testing it here? (or are we??)

Copy link
Contributor

Choose a reason for hiding this comment

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

We're testing that it gets stripped correctly!

Copy link
Contributor

Choose a reason for hiding this comment

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

ahh! I misread - that makes sense! thanks Colin!

@kylecarbs kylecarbs merged commit 4851d93 into main Jun 26, 2022
@kylecarbs kylecarbs deleted the splitipport branch June 26, 2022 21:22
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.

4 participants