Skip to content

Commit

Permalink
use string url as key
Browse files Browse the repository at this point in the history
  • Loading branch information
flotwig committed Nov 5, 2019
1 parent 9fa782a commit 1205147
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions packages/server/lib/util/buffers.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ const uri = require('./uri')

let buffers = []

const stripPort = (url) => {
return uri.removeDefaultPort(url).format()
}

module.exports = {
all () {
return buffers
Expand All @@ -20,8 +24,8 @@ module.exports = {
},

set (obj = {}) {
obj.url = uri.removeDefaultPort(obj.url)
obj.originalUrl = uri.removeDefaultPort(obj.originalUrl)
obj.url = stripPort(obj.url)
obj.originalUrl = stripPort(obj.originalUrl)

return buffers.push(_.pick(obj, 'url', 'originalUrl', 'jar', 'stream', 'response', 'details'))
},
Expand All @@ -41,7 +45,7 @@ module.exports = {
return b
}

return find(uri.removeDefaultPort(str))
return find(stripPort(str))
},

take (str) {
Expand Down

0 comments on commit 1205147

Please sign in to comment.