npm / npm-registry-client

http://npm.im/npm-registry-client
ISC License
264 stars 108 forks source link

fixed npm-notice functionality so that we can send messages from server to client #119

Closed bcoe closed 9 years ago

bcoe commented 9 years ago

It's expected that you can set the npm-notice header on the server-side and that the client will, in turn, output the message to the client.

The logic for outputting this message was, unfortunately, below the logic that returns early:

      if (!er || (er.message && er.message.match(/^SSL Error/))) {
        if (er) er.code = 'ESSL'
        return cb(er, parsed, raw, response)
      }

I've fixed this by moving the logic up, and adding a test.

zkat commented 9 years ago

Thanks <3

Merged as 9f0cfda