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

bcurl: use 127.0.0.1 by default. #20

Merged
merged 1 commit into from
May 14, 2022
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion lib/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ class ClientOptions {
constructor(options) {
this.ssl = false;
this.strictSSL = true;
this.host = 'localhost';
this.host = '127.0.0.1';
this.port = 80;
this.path = '/';
this.headers = null;
Expand Down
5 changes: 2 additions & 3 deletions test/http-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,15 +163,14 @@ describe('Client HTTP', function() {
seenDeepEqual(false),
reqHeaderDeepEqual('user-agent', 'brq'),
reqHeaderDeepEqual('foo', 'bar'),
reqHeaderDeepEqual('host', `localhost:${port}`),
reqHeaderDeepEqual('host', `127.0.0.1:${port}`),
end()
]);

await client.get('/');
assert(seen);
});


it('should send json rpc', async () => {
client = new Client({port});

Expand Down Expand Up @@ -238,7 +237,7 @@ describe('Client HTTP', function() {
end()
]);

await client.get('/')
await client.get('/');
assert(seen);
});

Expand Down