New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow empty strings. #4
Allow empty strings. #4
Conversation
The build failure seems to be due to dependency version changes? If I pin request/request@v2.75.0...v2.76.0 Installing 2.76.0 dep from 2.75.0 gives me:
|
5b40d89
to
44b7099
Compare
Found it; request/request#2431 changes the timeout to happen on socket connect, not request.start() Updated the request dependency to include this change, and updated nock to be able to use the socket timeout feature. |
@@ -14,7 +14,7 @@ function getValue (field, callback) { | |||
timeout: this.timeout, | |||
json: true | |||
}, function (error, response, body) { | |||
if (!error && response.statusCode === 200 && body.value) { | |||
if (!error && response.statusCode === 200 && (body.value || body.value === "")) { |
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.
Didn't realize this, doesn't this mean 0
and false
are also going to fail? Can we change this to body.value !== undefined
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.
Sure, that makes sense.
@@ -25,11 +25,11 @@ | |||
"dependencies": { | |||
"get-stdin": "^0.1.0", | |||
"nomnom": "^1.8.0", | |||
"request": "^2.37.0" | |||
"request": "2.76.0" |
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.
So the intention is to pin to 2.76 now? Just to be clear.
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.
Oh, whoops. That was from some testing. I'll change it to '^2.76.0'.
Sorry for the delay, just some quick questions. |
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.
|
thanks! |
Before this change, you get an error if you've explicitly set a value to empty and later try to retrieve it.