Skip to content

Commit

Permalink
refactor: remove username:password when stripping origin
Browse files Browse the repository at this point in the history
  • Loading branch information
erezrokah committed Nov 2, 2020
1 parent ac9ce0d commit 1c41dc4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/utils/proxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ const isExternal = function (match) {
return match.to && match.to.match(/^https?:\/\//)
}

const stripOrigin = function (url) {
const stripOrigin = function ({ pathname, search, hash }) {
// Get the URL after http://host:port
return url.toString().replace(url.origin, '')
return `${pathname}${search}${hash}`
}

const proxyToExternalUrl = function ({ req, res, dest, destURL }) {
Expand Down

0 comments on commit 1c41dc4

Please sign in to comment.