-
Notifications
You must be signed in to change notification settings - Fork 308
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
replaced superagent with request #131
Conversation
212cbb2
to
313fb18
Compare
e8f2c1d
to
f075dfb
Compare
Discussed not returning from reject/resolve but this was previous behavior, so not changing to keep consistency with prior behavior. |
LGTM |
@@ -56,6 +56,30 @@ utils.wrapPropertyMethod = function (Parent, name, propertyMethod) { | |||
*/ | |||
utils.getRequestPromise = function (settings) { | |||
return new Promise(function (resolve, reject) { | |||
var json = null; |
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.
where are you using these?
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.
cleared
@@ -8,12 +8,12 @@ module.exports = function (body, boundary) { | |||
.split(partRegexp) | |||
.forEach(function (part) { | |||
// Ignore empty strings in the array. | |||
if (part.length === 0) return; | |||
if (part.trim().length === 0) return; |
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.
is this request
related? change in tests?
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.
yes, not really sure about this. But the headers on request has some whitespaces between that's why I needed to trim them.
This is using request:
----------------------------454702286045209682268136
Content-Disposition: form-data; name="users"; filename="users.json"
Content-Type: application/json
[]
----------------------------454702286045209682268136
Content-Disposition: form-data; name="connection_id"
con_test
----------------------------454702286045209682268136--
and this superagent:
----------------------------392237490125139977580197Content-Disposition: form-data; name="connection_id"con_test----------------------------392237490125139977580197Content-Disposition: form-data; name="users"; filename="users.json"Content-Type: application/json[]----------------------------392237490125139977580197--
Do you think it can be an issue?
@@ -1,6 +1,7 @@ | |||
var request = require('superagent'); | |||
var request = require('request'); |
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.
why don't we use request-promise
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.
I just wanted to made as few changes as possible while providing consistency
This PR replaces
superagent
withrequest
and adds some workarounds to not break current behavior.