Skip to content
This repository was archived by the owner on Apr 3, 2019. It is now read-only.

Commit 6059aca

Browse files
authored
fix(emails): Make all request paths containing an email use hex encoding. (#1); r=philbooth
1 parent d7cb9ed commit 6059aca

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

db-server/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ function createServer(db) {
9494
api.post('/account/:id/emails', withIdAndBody(db.createEmail))
9595
api.del('/account/:id/emails/:email',
9696
op(function (req) {
97-
return db.deleteEmail(req.params.id, req.params.email)
97+
return db.deleteEmail(req.params.id, Buffer(req.params.email, 'hex').toString('utf8'))
9898
})
9999
)
100100

db-server/test/backend/remote.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ module.exports = function(cfg, makeServer) {
192192
assert.equal(!! result[2].isPrimary, false, 'isPrimary is false on thirdEmailRecord email')
193193
assert.equal(!! result[2].isVerified, false, 'matches secondEmail thirdEmailRecord')
194194

195-
return client.delThen('/account/' + user.accountId + '/emails/' + secondEmailRecord.email)
195+
return client.delThen('/account/' + user.accountId + '/emails/' + emailToHex(secondEmailRecord.email))
196196
})
197197
.then(function (r) {
198198
respOkEmpty(r)

0 commit comments

Comments
 (0)