Comparing version 0.2.20 to 0.2.21
@@ -110,2 +110,4 @@ # Release Notes | ||
- packages upgrade | ||
### 0.2.20 | ||
- configurable sauce rest root | ||
@@ -112,0 +114,0 @@ ### TODO |
@@ -189,9 +189,12 @@ var EventEmitter = require('events').EventEmitter, | ||
} | ||
var jobUpdateUrl = url.parse(url.resolve( | ||
var jobUpdateUrl = url.resolve( | ||
this.sauceRestRoot.replace(/\/?$/,'/'), | ||
this.configUrl.auth.replace(/:.*$/,'') + '/jobs/' + this.sessionID)); | ||
jobUpdateUrl.auth = this.configUrl.auth; | ||
this.configUrl.auth.replace(/:.*$/,'') + '/jobs/' + this.sessionID); | ||
var httpOpts = { | ||
url: url.format(jobUpdateUrl), | ||
url: jobUpdateUrl, | ||
method: 'PUT', | ||
auth: { | ||
user: this.configUrl.auth.split(':')[0], | ||
pass: this.configUrl.auth.split(':')[1], | ||
}, | ||
headers: { | ||
@@ -203,5 +206,10 @@ 'Content-Type': 'text/json' | ||
}; | ||
httpUtils.requestWithoutRetry(httpOpts, this.emit, function(err) { | ||
httpUtils.requestWithoutRetry(httpOpts, this.emit, function(err, resp) { | ||
if(err) { return done(err); } | ||
_this.emit('http', 'POST' , '/rest/v1/:user/jobs/:sessionID', jsonData); | ||
if(resp.statusCode !== 200) { | ||
return done(new Error("Sauce job update failed with http status code:" + | ||
resp.statusCode)); | ||
} | ||
_this.emit('http', 'POST' , '/rest/v1/:user/jobs/:sessionID', | ||
jsonData ? JSON.stringify(jsonData) : ''); | ||
done(); | ||
@@ -208,0 +216,0 @@ }); |
@@ -10,3 +10,3 @@ { | ||
], | ||
"version": "0.2.20", | ||
"version": "0.2.21", | ||
"author": "Adam Christian <adam.christian@gmail.com>", | ||
@@ -13,0 +13,0 @@ "contributors": [ |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
674481
12579