aws-rum-web
Advanced tools
Comparing version 1.17.1 to 1.17.2
@@ -5,2 +5,8 @@ # Changelog | ||
### [1.17.2](https://github.com/aws-observability/aws-rum-web/compare/v1.17.1...v1.17.2) (2024-04-03) | ||
### Bug Fixes | ||
* Record resources with invalid names ([#532](https://github.com/aws-observability/aws-rum-web/issues/532)) ([1da86e7](https://github.com/aws-observability/aws-rum-web/commit/1da86e7b42aa9545f623a5d55ca7859481b81e54)) | ||
### [1.17.1](https://github.com/aws-observability/aws-rum-web/compare/v1.17.0...v1.17.1) (2024-02-26) | ||
@@ -7,0 +13,0 @@ |
@@ -19,3 +19,3 @@ "use strict"; | ||
var EventBus_1 = require("../event-bus/EventBus"); | ||
var webClientVersion = '1.17.1'; | ||
var webClientVersion = '1.17.2'; | ||
/** | ||
@@ -22,0 +22,0 @@ * A cache which stores events generated by telemetry plugins. |
@@ -75,6 +75,3 @@ "use strict"; | ||
var name = _a.name, startTime = _a.startTime, initiatorType = _a.initiatorType, duration = _a.duration, transferSize = _a.transferSize; | ||
var pathRegex = /.*\/application\/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\/events/; | ||
var entryUrl = new URL(name); | ||
if (entryUrl.host === _this.context.config.endpointUrl.host && | ||
pathRegex.test(entryUrl.pathname)) { | ||
if ((0, common_utils_1.isPutRumEventsCall)(name, _this.context.config.endpointUrl.hostname)) { | ||
// Ignore calls to PutRumEvents (i.e., the CloudWatch RUM data | ||
@@ -81,0 +78,0 @@ // plane), otherwise we end up in an infinite loop of recording |
@@ -116,1 +116,2 @@ export declare enum ResourceType { | ||
export declare const isLongTaskSupported: () => boolean; | ||
export declare const isPutRumEventsCall: (url: string, endpointHost: string) => boolean; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.isLongTaskSupported = exports.isFCPSupported = exports.isLCPSupported = exports.httpStatusText = exports.getResourceFileType = exports.shuffle = exports.performanceKey = exports.InitiatorType = exports.ResourceType = void 0; | ||
exports.isPutRumEventsCall = exports.isLongTaskSupported = exports.isFCPSupported = exports.isLCPSupported = exports.httpStatusText = exports.getResourceFileType = exports.shuffle = exports.performanceKey = exports.InitiatorType = exports.ResourceType = void 0; | ||
var ResourceType; | ||
@@ -199,1 +199,14 @@ (function (ResourceType) { | ||
exports.isLongTaskSupported = isLongTaskSupported; | ||
/** PutRumEvents regex pattern */ | ||
var putRumEventsPattern = /.*\/application\/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\/events/; | ||
var isPutRumEventsCall = function (url, endpointHost) { | ||
try { | ||
return (new URL(url).hostname === endpointHost && | ||
putRumEventsPattern.test(url)); | ||
} | ||
catch (_) { | ||
// Ignore invalid URLs | ||
return false; | ||
} | ||
}; | ||
exports.isPutRumEventsCall = isPutRumEventsCall; |
@@ -16,3 +16,3 @@ var __assign = (this && this.__assign) || function () { | ||
import EventBus, { Topic } from '../event-bus/EventBus'; | ||
var webClientVersion = '1.17.1'; | ||
var webClientVersion = '1.17.2'; | ||
/** | ||
@@ -19,0 +19,0 @@ * A cache which stores events generated by telemetry plugins. |
@@ -28,3 +28,3 @@ var __extends = (this && this.__extends) || (function () { | ||
import { InternalPlugin } from '../InternalPlugin'; | ||
import { getResourceFileType, shuffle } from '../../utils/common-utils'; | ||
import { getResourceFileType, isPutRumEventsCall, shuffle } from '../../utils/common-utils'; | ||
import { PERFORMANCE_RESOURCE_EVENT_TYPE } from '../utils/constant'; | ||
@@ -73,6 +73,3 @@ import { defaultPerformancePluginConfig } from '../utils/performance-utils'; | ||
var name = _a.name, startTime = _a.startTime, initiatorType = _a.initiatorType, duration = _a.duration, transferSize = _a.transferSize; | ||
var pathRegex = /.*\/application\/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\/events/; | ||
var entryUrl = new URL(name); | ||
if (entryUrl.host === _this.context.config.endpointUrl.host && | ||
pathRegex.test(entryUrl.pathname)) { | ||
if (isPutRumEventsCall(name, _this.context.config.endpointUrl.hostname)) { | ||
// Ignore calls to PutRumEvents (i.e., the CloudWatch RUM data | ||
@@ -79,0 +76,0 @@ // plane), otherwise we end up in an infinite loop of recording |
@@ -116,1 +116,2 @@ export declare enum ResourceType { | ||
export declare const isLongTaskSupported: () => boolean; | ||
export declare const isPutRumEventsCall: (url: string, endpointHost: string) => boolean; |
@@ -190,1 +190,13 @@ export var ResourceType; | ||
}; | ||
/** PutRumEvents regex pattern */ | ||
var putRumEventsPattern = /.*\/application\/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\/events/; | ||
export var isPutRumEventsCall = function (url, endpointHost) { | ||
try { | ||
return (new URL(url).hostname === endpointHost && | ||
putRumEventsPattern.test(url)); | ||
} | ||
catch (_) { | ||
// Ignore invalid URLs | ||
return false; | ||
} | ||
}; |
@@ -116,1 +116,2 @@ export declare enum ResourceType { | ||
export declare const isLongTaskSupported: () => boolean; | ||
export declare const isPutRumEventsCall: (url: string, endpointHost: string) => boolean; |
{ | ||
"name": "aws-rum-web", | ||
"version": "1.17.1", | ||
"version": "1.17.2", | ||
"sideEffects": false, | ||
@@ -5,0 +5,0 @@ "description": "The Amazon CloudWatch RUM web client.", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1357558
16788