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

fix: silence annoying network permission popups on macos #157

Merged
merged 1 commit into from
Nov 30, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions httpbin/cmd/cmd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -459,18 +459,22 @@ func TestMainImpl(t *testing.T) {
wantOut: "error: could not look up real hostname: hostname failure",
},
"server error": {
args: []string{"-port", "-256"},
args: []string{
"-port", "-256",
"-host", "127.0.0.1", // default of 0.0.0.0 causes annoying permission popup on macOS
},
wantCode: 1,
wantOut: "go-httpbin listening on http://0.0.0.0:-256\nerror: listen tcp: address -256: invalid port\n",
wantOut: "go-httpbin listening on http://127.0.0.1:-256\nerror: listen tcp: address -256: invalid port\n",
},
"tls cert error": {
args: []string{
"-host", "127.0.0.1", // default of 0.0.0.0 causes annoying permission popup on macOS
"-port", "0",
"-https-cert-file", "./https-cert-does-not-exist",
"-https-key-file", "./https-key-does-not-exist",
},
wantCode: 1,
wantOut: "go-httpbin listening on https://0.0.0.0:0\nerror: open ./https-cert-does-not-exist: no such file or directory\n",
wantOut: "go-httpbin listening on https://127.0.0.1:0\nerror: open ./https-cert-does-not-exist: no such file or directory\n",
},
}

Expand Down
Loading