Skip to content

Commit

Permalink
Ensure paths are escaped to account for names used as IDs (#963)
Browse files Browse the repository at this point in the history
* encode path for VPN connection requests

Ensures paths are properly encoded in the event they contain spaces or special characters

* remove reference to deleteVPN that has been previously removed
  • Loading branch information
Jillian Tullo committed Jul 27, 2018
1 parent 171b4e5 commit a431964
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions packages/spaces/lib/vpn-connections.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,13 @@ module.exports = function (heroku) {
}

function deleteVPNConnection (space, name) {
let lib = require('../lib/vpn')(heroku)

if (!name) {
return lib.deleteVPN(space)
}

return request('DELETE', `/spaces/${space}/vpn-connections/${name}`)
}

function request (method, path, body) {
return heroku.request({
method: method,
path: path,
path: encodeURI(path),
body: body
})
}
Expand Down

0 comments on commit a431964

Please sign in to comment.