Skip to content

Commit cc799f0

Browse files
authored
Fix default port and host overrides (#6810)
* Fix default port and host overrides * Update package.json
1 parent 02ba909 commit cc799f0

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

net.coffee

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,12 @@ aropt = util.aropt
9494
mkAtom = util.mkAtom
9595
mkErr = util.mkErr
9696

97-
# These are the default hostname and port used by RethinkDB
98-
DEFAULT_HOST = 'localhost'
99-
DEFAULT_PORT = 28015
100-
101-
module.exports.DEFAULT_HOST = DEFAULT_HOST
102-
module.exports.DEFAULT_PORT = DEFAULT_PORT
97+
# These are the default hostname and port used by RethinkDB.
98+
# Set the default hostname and port on the exported constants, to
99+
# keep backward compatibility when somebody would like to override
100+
# the default port or host name.
101+
module.exports.DEFAULT_HOST = 'localhost'
102+
module.exports.DEFAULT_PORT = 28015
103103

104104
# These are strings returned by the server after a handshake
105105
# request. Since they must match exactly they're defined in
@@ -149,8 +149,8 @@ class Connection extends events.EventEmitter
149149
host = {host: host}
150150

151151
# Here we set all of the connection parameters to their defaults.
152-
@host = host.host || DEFAULT_HOST
153-
@port = host.port || DEFAULT_PORT
152+
@host = host.host || exports.DEFAULT_HOST
153+
@port = host.port || exports.DEFAULT_PORT
154154

155155
# One notable exception to defaulting is the db name. If the
156156
# user doesn't specify it, we leave it undefined. On the

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "rethinkdb",
3-
"version": "2.4.0",
3+
"version": "2.4.1",
44
"main": "rethinkdb",
55
"description": "This package provides the JavaScript driver library for the RethinkDB database server for use in your node application.",
66
"keywords": ["database", "NoSQL", "reql", "query language"],

0 commit comments

Comments
 (0)