Skip to content

Commit

Permalink
fix(exec): correctly join URL components (#402)
Browse files Browse the repository at this point in the history
  • Loading branch information
silasbw committed Jan 28, 2019
1 parent 84ce275 commit a557d97
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
3 changes: 2 additions & 1 deletion lib/backends/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

const request = require('request')
const qs = require('qs')
const urljoin = require('url-join')
const WebSocket = require('ws')

/**
Expand Down Expand Up @@ -56,7 +57,7 @@ function isUpgradeRequired (body) {

function upgradeRequest (options, cb) {
const queryParams = qs.stringify(options.qs, { indices: false })
const wsUrl = `${options.baseUrl}/${options.uri}?${queryParams}`
const wsUrl = urljoin(options.baseUrl, options.uri, `?${queryParams}`)
const protocol = 'base64.channel.k8s.io'
const ws = new WebSocket(wsUrl, protocol, options)

Expand Down
5 changes: 5 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,12 @@
],
"dependencies": {
"deepmerge": "^3.0.0",
"swagger-fluent": "^3.1.1",
"js-yaml": "^3.10.0",
"openid-client": "^2.4.4",
"qs": "^6.5.2",
"request": "^2.88.0",
"swagger-fluent": "^3.1.1",
"url-join": "^4.0.0",
"ws": "^6.0.0"
},
"devDependencies": {
Expand Down

0 comments on commit a557d97

Please sign in to comment.