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

Rename and update redirect header for QuickPulse #997

Merged
merged 14 commits into from
Aug 5, 2022

Conversation

ramanujbhattacharjee93
Copy link

No description provided.

@@ -114,7 +115,8 @@ class QuickPulseSender {
const req = https.request(options, (res: http.IncomingMessage) => {
if (res.statusCode == 200) {
const shouldPOSTData = res.headers[QuickPulseConfig.subscribed] === "true";
const redirectHeader = res.headers[QuickPulseConfig.endpointRedirect] ? res.headers[QuickPulseConfig.endpointRedirect].toString() : null;
const redirectHeader = res.headers[QuickPulseConfig.endpointRedirect] ? new url.URL(res.headers[QuickPulseConfig.endpointRedirect].toString()).host : null;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this the best approach? What we do here is take the host part of whatever URL is in the header, and then append QuickPulseService.svc to it. Isn't it better to just use whatever is in the header? That way if we need to change the QuickPulseService.svc part in the header - we can do that, and the SDK will follow it. Why have it hardcoded here?..

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What you are describing was the original issue we had here.

dotNET -> URI - host extraction, thus it does not care of there is QuickPulseService.svc in the call
Java -> Takes as is and uses it, thus it requires our QuickPulseService.svc be present
node -> Takes the value, DOES NOT do the host extraction and appends QuickPulseService.svc to it. hence it fails if the suffix QuickPulseService.svc is provided

What I am doing here is changing it to have the same approach as dot net. Also for the regular QP endpoint, all SDKs do the host extraction and so they do not care for the presence of QuickPulseService.svc.

So this change will make everything work the same.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So every SDK has /QuickPulseService.svc hardcoded even for normal non-live endpoint?.. That is pretty weird, but I guess we have to follow that here as well then...

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dont think those are for non live endpoints - and its every SDK except Java right now, I will reconcile that as well with dotnet

@ramanujbhattacharjee93 ramanujbhattacharjee93 marked this pull request as ready for review August 3, 2022 00:17
@hectorhdzg hectorhdzg merged commit 6031c83 into microsoft:develop Aug 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants