-
Notifications
You must be signed in to change notification settings - Fork 240
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
fix: dont block corr on empty location host #1135
Conversation
@@ -153,7 +153,7 @@ export class AjaxMonitor implements ITelemetryPlugin, IDependenciesPlugin, IInst | |||
} | |||
return init; | |||
} else if (xhr) { // XHR | |||
if (this.currentWindowHost && CorrelationIdHelper.canIncludeCorrelationHeader(this._config, xhr.ajaxData.getAbsoluteUrl(), | |||
if (CorrelationIdHelper.canIncludeCorrelationHeader(this._config, xhr.ajaxData.getAbsoluteUrl(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this.currentWindowHost
is empty, then canIncludeCorrelationHeader
will return false with this check here then this if check is still false correct? Unless requestHost
is empty too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I don't think it will affect that check at all unless requestHost
is somehow falsy as well. Since it comes from an actual request being made I don't think its possible. From what I can tell, the this.currentWindow host &&
check isn't actually useful.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah I agree to remove it, I mean if the case happens again (this.currentWindowHost
is empty), it still can't pass this if check, the logic under if will not run as before. Is that the expected behavior?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've modified it to not pass the if check anymore unless enableCorsCorrelation is enable and it also passes the included/excluded domains check. I consider an empty currentWindowHost
an undefined scenario, so my thought it to always reject it unless the user has opted into a particular CORS correlation scenario.
Fixes #1115
Removes unneeded undefined check on
this.currentWindowHost
before checking if correlation headers should be included onfetch
requests