Skip to content

Commit

Permalink
fix: silence annoying network permission popups on macos (#157)
Browse files Browse the repository at this point in the history
  • Loading branch information
mccutchen authored Nov 30, 2023
1 parent e0324b1 commit d53489d
Showing 1 changed file with 7 additions and 3 deletions.
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

0 comments on commit d53489d

Please sign in to comment.