Skip to content

Commit

Permalink
fix: Capture assets using the same hostname, regardless of port (#535)
Browse files Browse the repository at this point in the history
Currently, if someone is serving their app from `localhost:3001` and then
serves their assets from `localhost:3002`, we will skip the assets coming from
`localhost:3002`. This is because we're taking the port into account for asset
discovery right now.

This change removes the port from consideration and captures all assets based on
the `hostname` rather than `host`.
  • Loading branch information
Robdel12 authored Jul 17, 2020
1 parent 9b58b65 commit d490fa9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/services/response-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export default class ResponseService extends PercyClientService {
const request = response.request()
const parsedRootResourceUrl = new URL(rootResourceUrl)
const isRedirect = REDIRECT_STATUSES.includes(response.status())
const rootUrl = `${parsedRootResourceUrl.protocol}//${parsedRootResourceUrl.host}`
const rootUrl = `${parsedRootResourceUrl.protocol}//${parsedRootResourceUrl.hostname}`

if (request.url() === rootResourceUrl) {
// Always skip the root resource
Expand Down

0 comments on commit d490fa9

Please sign in to comment.