Skip to content

Commit

Permalink
always discard default ports when get/set buffer - fixes #5367
Browse files Browse the repository at this point in the history
  • Loading branch information
flotwig committed Nov 5, 2019
1 parent d5b0721 commit ff2d9df
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions packages/server/lib/util/buffers.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ module.exports = {
},

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

return buffers.push(_.pick(obj, 'url', 'originalUrl', 'jar', 'stream', 'response', 'details'))
},

Expand All @@ -38,17 +41,7 @@ module.exports = {
return b
}

let parsed = uri.parse(str)

//# if we're on https and we have a port
//# then attempt to find the buffer by
//# slicing off the port since our buffer
//# was likely stored without a port
if ((parsed.protocol === 'https:') && parsed.port) {
parsed = uri.removePort(parsed)

return find(parsed.format())
}
return find(uri.removeDefaultPort(str))
},

take (str) {
Expand Down

0 comments on commit ff2d9df

Please sign in to comment.