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

Commit 1e9693a

Browse files
authored
Merge pull request #213 from mozilla/hex-email-bounces
fix(emailBounces): receive the email parameter in the url as hex r=rfk
2 parents 7b2b2bc + e1c078b commit 1e9693a

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

fxa-auth-db-server/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ function createServer(db) {
107107
api.get('/securityEvents/:id/ip/:ipAddr', withParams(db.securityEvents))
108108
api.post('/securityEvents', withBodyAndQuery(db.createSecurityEvent))
109109

110-
api.get('/emailBounces/:email', op(req => db.fetchEmailBounces(req.params.email)))
110+
api.get('/emailBounces/:id', withIdAndBody(db.fetchEmailBounces))
111111
api.post('/emailBounces', withBodyAndQuery(db.createEmailBounce))
112112

113113
api.get('/emailRecord/:id', withIdAndBody(db.emailRecord))

fxa-auth-db-server/test/backend/remote.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1142,7 +1142,7 @@ module.exports = function(cfg, server) {
11421142
.then(
11431143
function (r) {
11441144
respOkEmpty(t, r)
1145-
return client.getThen('/emailBounces/' + email)
1145+
return client.getThen('/emailBounces/' + Buffer(email).toString('hex'))
11461146
}
11471147
)
11481148
.then(

lib/db/mysql.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1104,8 +1104,8 @@ module.exports = function (log, error) {
11041104
}
11051105

11061106
const FETCH_EMAIL_BOUNCES = 'CALL fetchEmailBounces_1(?)'
1107-
MySql.prototype.fetchEmailBounces = function (email) {
1108-
return this.read(FETCH_EMAIL_BOUNCES, [email])
1107+
MySql.prototype.fetchEmailBounces = function (emailBuffer) {
1108+
return this.read(FETCH_EMAIL_BOUNCES, [emailBuffer.toString('utf8')])
11091109
.then(result => result[0])
11101110
}
11111111

0 commit comments

Comments
 (0)