Skip to content

Commit

Permalink
Merge pull request #369 from GSA/lc/1157-third-party-service-url
Browse files Browse the repository at this point in the history
Update filtering and expose URLs field
  • Loading branch information
luke-at-flexion authored Sep 19, 2024
2 parents 830fbdd + d54041a commit 8c2a79a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions entities/core-result.entity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -289,13 +289,12 @@ export class CoreResult {
thirdPartyServiceDomains?: string;

@Column({ nullable: true })
//@Expose({ name: 'third_party_service_urls' })
@Exclude()
@Expose({ name: 'third_party_service_urls' })
@Transform((value: string) => {
if (value) {
return value.split(',');
} else {
return 'null';
return null;
}
})
thirdPartyServiceUrls?: string;
Expand Down Expand Up @@ -526,6 +525,7 @@ export class CoreResult {
'dap_version',
'ga_tag_id',
'third_party_service_domains',
'third_party_service_urls',
'third_party_service_count',
'cookie_domains',
'viewport_meta_tag',
Expand Down
4 changes: 2 additions & 2 deletions libs/core-scanner/src/scans/third-party.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ export function thirdPartyServicesUrls ( parentLogger: Logger, outboundRequests:
const url = request && new URL(request.url());
if (parsedUrl.hostname != url.hostname && !request.isNavigationRequest()) {
const fullUrl = removeQueryParameters(url.toString());
const isFileLoad = fullUrl.startsWith('data:') || fullUrl.startsWith('blob:');
if( !isFileLoad) {
const isFileLoad = fullUrl.startsWith('http') || fullUrl.startsWith('https');
if( isFileLoad) {
thirdPartyDomains.push(fullUrl);
}
}
Expand Down
2 changes: 1 addition & 1 deletion libs/snapshot/src/serializers/json-serializer.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ describe('JsonSerializer', () => {

const result = serializer.serialize([website]);
const expectedResult =
'[{"source_list":null,"login":null,"third_party_service_domains":null,"cookie_domains":null,"required_links_url":null,"required_links_text":null,"robots_txt_sitemap_locations":null,"uswds_usa_class_list":null}]';
'[{"source_list":null,"login":null,"third_party_service_domains":null,"third_party_service_urls":null,"cookie_domains":null,"required_links_url":null,"required_links_text":null,"robots_txt_sitemap_locations":null,"uswds_usa_class_list":null}]';

expect(result).toEqual(expectedResult);
});
Expand Down

0 comments on commit 8c2a79a

Please sign in to comment.