This repository has been archived by the owner on Dec 11, 2019. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
If "rawP" option is passed to internal request.request...
…don’t try to parse JSON — this is the cause of the mysterious “ledger-geoip warning: {}” messages!
- Loading branch information
bb56af5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Auditor: @bsclifton
bb56af5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 😄 If you wanted to be consistent, you could make it match the one here (or expose a wrapper for the check in the ledger-geoip module):
https://github.com/brave/ledger-geoip/blob/master/index.js#L246
looks like:
payload = (options.rawP) ? body : (response.statusCode !== 204) ? JSON.parse(body) : null
bb56af5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
true, but the problem is that rawP is stripped out of the
options
by that point...