Catch errors on header decode in rfc2231 #1599

Merged
merged 1 commit into from Sep 23, 2016

Conversation

Projects
None yet
2 participants
@baudehlo
Collaborator

baudehlo commented Sep 16, 2016

Fixes #1596 .

Changes proposed in this pull request:

  • Catch errors from decodeURIcomponent()

Checklist:

  • docs updated
  • tests updated
+ value = decodeURIComponent(value);
+ }
+ catch (e) {
+ logger.logerror("Decode header failed: " + key + ": " + value);

This comment has been minimized.

@msimerson

msimerson Sep 16, 2016

Member

Would logging the actual error be good?

@msimerson

msimerson Sep 16, 2016

Member

Would logging the actual error be good?

This comment has been minimized.

@baudehlo

baudehlo Sep 23, 2016

Collaborator

I get the feeling it won't help much. Knowing the actual key/value is more beneficial.

@baudehlo

baudehlo Sep 23, 2016

Collaborator

I get the feeling it won't help much. Knowing the actual key/value is more beneficial.

@baudehlo

This comment has been minimized.

Show comment
Hide comment
@baudehlo

baudehlo Sep 16, 2016

Collaborator

Seemed pretty useless from the ticket, but sure why not.

On Sep 16, 2016, at 12:42 AM, Matt Simerson notifications@github.com wrote:

@msimerson commented on this pull request.

In mailheader.js:

@@ -135,7 +135,12 @@ function _decode_rfc2231 (params) {

     params.cur_key = key_actual;
     params.keys[key_actual] = '';
  •    value = decodeURIComponent(value);
    
  •    try {
    
  •        value = decodeURIComponent(value);
    
  •    }
    
  •    catch (e) {
    
  •        logger.logerror("Decode header failed: " + key + ": " + value);
    
    Would logging the actual error be good?


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.

Collaborator

baudehlo commented Sep 16, 2016

Seemed pretty useless from the ticket, but sure why not.

On Sep 16, 2016, at 12:42 AM, Matt Simerson notifications@github.com wrote:

@msimerson commented on this pull request.

In mailheader.js:

@@ -135,7 +135,12 @@ function _decode_rfc2231 (params) {

     params.cur_key = key_actual;
     params.keys[key_actual] = '';
  •    value = decodeURIComponent(value);
    
  •    try {
    
  •        value = decodeURIComponent(value);
    
  •    }
    
  •    catch (e) {
    
  •        logger.logerror("Decode header failed: " + key + ": " + value);
    
    Would logging the actual error be good?


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.

@baudehlo baudehlo merged commit 6769a25 into master Sep 23, 2016

3 checks passed

codecov/project 35.93% (+<.01%) compared to 3150d20
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@msimerson msimerson deleted the catch_header_decompose branch Sep 24, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment