Skip to content

Commit

Permalink
fix: remove superfluous slashes
Browse files Browse the repository at this point in the history
Removed superfluous slashes from URLs, to ensure the correct server
behavior.

Change-Id: I3cbab09169664e759bba5da48a2cef2f6850ca30
  • Loading branch information
terinjokes committed Feb 13, 2018
1 parent a06aad5 commit eb2b118
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 15 deletions.
6 changes: 3 additions & 3 deletions lib/Resource.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,18 @@ const BASIC_METHODS = {
}),
read: method({
method: 'GET',
path: '/:id',
path: ':id',
}),
edit: method({
method: 'PATCH',
path: '/:id',
path: ':id',
}),
add: method({
method: 'POST',
}),
del: method({
method: 'DELETE',
path: '/:id',
path: ':id',
}),
};

Expand Down
2 changes: 1 addition & 1 deletion lib/resources/DNSRecords.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ module.exports = auto(
*/
edit: method({
method: 'PUT',
path: '/:id',
path: ':id',
}),

/**
Expand Down
1 change: 0 additions & 1 deletion lib/resources/ZoneSettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ module.exports = auto(
*/
editAll: method({
method: 'PATCH',
path: '/',
}),

/**
Expand Down
4 changes: 2 additions & 2 deletions lib/resources/Zones.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ module.exports = auto(
*/
activationCheck: method({
method: 'PUT',
path: '/:id/activation_check',
path: ':id/activation_check',
}),

/**
Expand All @@ -59,7 +59,7 @@ module.exports = auto(
*/
purgeCache: method({
method: 'DELETE',
path: '/:id/purge_cache',
path: ':id/purge_cache',
}),

/**
Expand Down
16 changes: 8 additions & 8 deletions test/method.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ describe('method', () => {

resource._client = client; // eslint-disable-line no-underscore-dangle

td.when(resource.createFullPath('/:id')).thenReturn('example/:id');
td.when(resource.createFullPath(':id')).thenReturn('example/:id');
td.when(client.request(), {ignoreExtraArgs: true}).thenReject();
td
.when(
Expand All @@ -94,7 +94,7 @@ describe('method', () => {

const subject = method({
method: 'POST',
path: '/:id',
path: ':id',
}).bind(resource);

return subject(42).then(resp => assert.deepEqual(resp, body));
Expand All @@ -106,12 +106,12 @@ describe('method', () => {

resource._client = client; // eslint-disable-line no-underscore-dangle

td.when(resource.createFullPath('/:id')).thenReturn('example/:id');
td.when(resource.createFullPath(':id')).thenReturn('example/:id');
td.when(client.request(), {ignoreExtraArgs: true}).thenReject();

const subject = method({
method: 'POST',
path: '/:id',
path: ':id',
}).bind(resource);

return subject().catch(err =>
Expand All @@ -128,7 +128,7 @@ describe('method', () => {

resource._client = client; // eslint-disable-line no-underscore-dangle

td.when(resource.createFullPath('/:id')).thenReturn('example/:id');
td.when(resource.createFullPath(':id')).thenReturn('example/:id');
td.when(client.request(), {ignoreExtraArgs: true}).thenReject();
td
.when(
Expand All @@ -148,7 +148,7 @@ describe('method', () => {

const subject = method({
method: 'POST',
path: '/:id',
path: ':id',
}).bind(resource);

return subject(42, {
Expand Down Expand Up @@ -203,7 +203,7 @@ describe('method', () => {

resource._client = client; // eslint-disable-line no-underscore-dangle

td.when(resource.createFullPath('/:id')).thenReturn('example/:id');
td.when(resource.createFullPath(':id')).thenReturn('example/:id');
td.when(client.request(), {ignoreExtraArgs: true}).thenReject();
td
.when(
Expand All @@ -226,7 +226,7 @@ describe('method', () => {

const subject = method({
method: 'POST',
path: '/:id',
path: ':id',
}).bind(resource);

return subject(
Expand Down

0 comments on commit eb2b118

Please sign in to comment.