再修正一个方法名中的单词错误:`Form` -> `From`

pull/287/head
王良 2024-03-29 23:21:46 +08:00
parent fe31462c94
commit 15d4a88e15
3 changed files with 3 additions and 3 deletions

View File

@ -45,7 +45,7 @@ module.exports = class CertAndKeyContainer {
const _resolve = (_certObj) => { const _resolve = (_certObj) => {
if (once) { if (once) {
once = false once = false
const mappingHostNames = tlsUtils.getMappingHostNamesFormCert(_certObj.cert) const mappingHostNames = tlsUtils.getMappingHostNamesFromCert(_certObj.cert)
certPromiseObj.mappingHostNames = mappingHostNames // change certPromiseObj.mappingHostNames = mappingHostNames // change
resolve(_certObj) resolve(_certObj)
} }

View File

@ -90,7 +90,7 @@ module.exports = class FakeServersCenter {
log.error(e) log.error(e)
}) })
fakeServer.on('listening', () => { fakeServer.on('listening', () => {
const mappingHostNames = tlsUtils.getMappingHostNamesFormCert(certObj.cert) const mappingHostNames = tlsUtils.getMappingHostNamesFromCert(certObj.cert)
serverPromiseObj.mappingHostNames = mappingHostNames serverPromiseObj.mappingHostNames = mappingHostNames
resolve(serverObj) resolve(serverObj)
}) })

View File

@ -230,7 +230,7 @@ utils.isMappingHostName = function (DNSName, hostname) {
return (new RegExp(reg)).test(hostname) return (new RegExp(reg)).test(hostname)
} }
utils.getMappingHostNamesFormCert = function (cert) { utils.getMappingHostNamesFromCert = function (cert) {
let mappingHostNames = [] let mappingHostNames = []
mappingHostNames.push(cert.subject.getField('CN') ? cert.subject.getField('CN').value : '') mappingHostNames.push(cert.subject.getField('CN') ? cert.subject.getField('CN').value : '')
const altNames = cert.getExtension('subjectAltName') ? cert.getExtension('subjectAltName').altNames : [] const altNames = cert.getExtension('subjectAltName') ? cert.getExtension('subjectAltName').altNames : []