mirror of
https://github.com/brianc/node-postgres.git
synced 2025-12-08 20:16:25 +00:00
Send the client_encoding startup parameter value with more typical formatting
All non-alphanumerics are ignored, but `'utf-8'` is weird. `UTF8` is the canonical name, and is what libpq sends.
This commit is contained in:
parent
c8fb4168d4
commit
bf40f03788
@ -25,7 +25,7 @@ const startup = (opts: Record<string, string>): Buffer => {
|
||||
writer.addCString(key).addCString(opts[key])
|
||||
}
|
||||
|
||||
writer.addCString('client_encoding').addCString("'utf-8'")
|
||||
writer.addCString('client_encoding').addCString('UTF8')
|
||||
|
||||
var bodyBuffer = writer.addCString('').flush()
|
||||
// this message is sent without a code
|
||||
|
||||
@ -144,7 +144,7 @@ Connection.prototype.startup = function (config) {
|
||||
writer.addCString(key).addCString(val)
|
||||
})
|
||||
|
||||
writer.addCString('client_encoding').addCString("'utf-8'")
|
||||
writer.addCString('client_encoding').addCString('UTF8')
|
||||
|
||||
var bodyBuffer = writer.addCString('').flush()
|
||||
// this message is sent without a code
|
||||
|
||||
@ -28,7 +28,7 @@ test('sends startup message', function () {
|
||||
.addCString('database')
|
||||
.addCString('bang')
|
||||
.addCString('client_encoding')
|
||||
.addCString("'utf-8'")
|
||||
.addCString('UTF8')
|
||||
.addCString('')
|
||||
.join(true)
|
||||
)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user