fix(emails): Make all request paths containing an email use hex encoding. (#1); r=philbooth
This commit is contained in:
Родитель
d7cb9edf83
Коммит
6059acad73
|
@ -94,7 +94,7 @@ function createServer(db) {
|
|||
api.post('/account/:id/emails', withIdAndBody(db.createEmail))
|
||||
api.del('/account/:id/emails/:email',
|
||||
op(function (req) {
|
||||
return db.deleteEmail(req.params.id, req.params.email)
|
||||
return db.deleteEmail(req.params.id, Buffer(req.params.email, 'hex').toString('utf8'))
|
||||
})
|
||||
)
|
||||
|
||||
|
|
|
@ -192,7 +192,7 @@ module.exports = function(cfg, makeServer) {
|
|||
assert.equal(!! result[2].isPrimary, false, 'isPrimary is false on thirdEmailRecord email')
|
||||
assert.equal(!! result[2].isVerified, false, 'matches secondEmail thirdEmailRecord')
|
||||
|
||||
return client.delThen('/account/' + user.accountId + '/emails/' + secondEmailRecord.email)
|
||||
return client.delThen('/account/' + user.accountId + '/emails/' + emailToHex(secondEmailRecord.email))
|
||||
})
|
||||
.then(function (r) {
|
||||
respOkEmpty(r)
|
||||
|
|
Загрузка…
Ссылка в новой задаче