Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TelemetryClient.trackDependency should not assume 'data' property is an URL. #321

Closed
tmcgannon opened this issue Sep 12, 2017 · 1 comment
Labels
Milestone

Comments

@tmcgannon
Copy link

https://github.com/Microsoft/ApplicationInsights-node.js/blob/dd34598413b5b360a9b3153de2323559d00fbcfe/Library/TelemetryClient.ts#L103-L105

At the above code, if 'telemetry.target' property is not populated, it attempts to parse the 'data' field as an URL. This assumption should either be documented or the logic removed.

@OsvaldoRosado
Copy link
Member

Good catch! If data is not a url, does this cause an error or return undefined?
I believe this was to fill the target field for back-compat as it was introduced after data.

If this errors, I think its proper to catch this scenario and leave target unfilled, but this should still autopopulate when possible. Good point on documenting this behavior!

@OsvaldoRosado OsvaldoRosado added this to the 1.0 milestone Sep 23, 2017
OsvaldoRosado added a commit that referenced this issue Sep 23, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants