File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed
Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change 1+ v9.1.3 (2023-??-??)
2+ -------------------
3+ [fix] Escape values that are added to the msnodesqlv8 connection string that we construct ((#1479)[https://github.com/tediousjs/node-mssql/pull/1479])
4+
15v9.1.2 (2023-08-01)
26-------------------
37[fix] Support more named instance formats ([#1520](https://github.com/tediousjs/node-mssql/pull/1520))
Original file line number Diff line number Diff line change @@ -38,8 +38,15 @@ class ConnectionPool extends BaseConnectionPool {
3838 return this . config . options . trustedConnection ? 'Yes' : 'No'
3939 case 'encrypt' :
4040 return this . config . options . encrypt ? 'Yes' : 'No'
41- default :
42- return this . config [ key ] != null ? this . config [ key ] : ''
41+ default : {
42+ let val = this . config [ key ] || ''
43+ // quote strings that contain '{' or '}' but not ones that start and end with them (assume they are already quoted)
44+ if ( val && typeof val === 'string' && ! ( val . startsWith ( '{' ) && val . endsWith ( '}' ) ) && ( val . indexOf ( '{' ) !== - 1 || val . indexOf ( '}' ) !== - 1 ) ) {
45+ // quote values in `{}` and escape any existing ` }` chars
46+ val = `{${ val . replace ( / } / g, '}}' ) } }`
47+ }
48+ return val
49+ }
4350 }
4451 } )
4552
You can’t perform that action at this time.
0 commit comments