Skip to content

Commit

Permalink
Use POST method for REST transport (#66)
Browse files Browse the repository at this point in the history
* use POST method for rest transports

* enable skipped test cases for `getInstalledProducts()`

Signed-off-by: Xu Meng <[email protected]>
  • Loading branch information
dmabupt authored and abmusse committed Jul 4, 2019
1 parent 014aabf commit 6a9f91f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
10 changes: 7 additions & 3 deletions lib/transports/irest.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,12 @@ const iRestHttp = (config, xmlInput, done) => {
const options = {
host,
port,
path: `${path}?${xmlEnc}`,
method: 'GET',
path,
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'Content-Length': Buffer.byteLength(xmlEnc)
}
};

const request = http.request(options, (response) => {
Expand All @@ -78,7 +82,7 @@ const iRestHttp = (config, xmlInput, done) => {
request.on('error', (error) => {
done(error, null);
});

request.write(xmlEnc);
request.end();
};

Expand Down
3 changes: 0 additions & 3 deletions test/functional/ToolkitFunctional.js
Original file line number Diff line number Diff line change
Expand Up @@ -653,9 +653,6 @@ describe('Toolkit Functional Tests', () => {
transports.forEach((transport) => {
// eslint-disable-next-line func-names
it(`returns info for installed products using ${transport.name} transport`, function (done) {
if (transport.name === 'rest') {
this.skip();
}
const connection = transport.me;

const toolkit = new Toolkit(connection);
Expand Down
3 changes: 0 additions & 3 deletions test/functional/deprecated/iProdFunctional.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,6 @@ describe('iProd Functional Tests', () => {
transports.forEach((transport) => {
// eslint-disable-next-line func-names
it(`returns info for installed products using ${transport.name} transport`, function (done) {
if (transport.name === 'rest') {
this.skip();
}
const connection = transport.me;

const prod = new iProd(connection);
Expand Down

0 comments on commit 6a9f91f

Please sign in to comment.