lieser / dkim_verifier

DKIM Verifier Extension for Mozilla Thunderbird
MIT License
210 stars 35 forks source link

Issue: Relaxed canonicalization from a body with only empty lines #9

Closed ionum closed 11 years ago

ionum commented 11 years ago

If a body only has \r\n (empty lines) relaxed canonicalization should give an empty body.

"\r\n\r\n" should give "" "Something\r\n\r\n" should give "Something\r\n"

but

"\r\n\r\n" gives "\r\n"

See patch

++ b/chrome/content/dkim.js @@ -718,6 +718,10 @@ DKIM_Verifier.DKIMVerifier = (function() { // for some reason /(\r\n)*$/ doesn't work all the time (matching only last "\r\n") body = body.replace(/((\r\n)+)?$/,"\r\n");

lieser commented 11 years ago

Thanks for not only finding the bug, but also fixing it.

ionum commented 11 years ago

Pleasure ....