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

feat: support for sendBeacon requests #651

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

bardisg
Copy link

@bardisg bardisg commented Sep 7, 2023

Addition of support for intercepting sendBeacon request queueing in response to issue #640

Additionally, some code formatting fixes were auto applied from prettier that is used as pre-push hook

lib/interceptor.js Outdated Show resolved Hide resolved
lib/interceptor.js Outdated Show resolved Hide resolved
lib/interceptor.js Outdated Show resolved Hide resolved
Copy link
Contributor

@tehhowch tehhowch left a comment

Choose a reason for hiding this comment

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

Thanks for submitting the PR! I only have a few comments.

lib/interceptor.js Outdated Show resolved Hide resolved
Comment on lines 95 to 99
if (data instanceof Blob) {
return data.text().then(function (payload) {
return interceptSendBeacon(url, payload);
});
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we handle the other non-string kinds? (MDN suggests ArrayBuffer, TypedArray, DataView, FormData, pojos, URLSearchParams)

If we don't explicitly handle them, it would be good to at least verify what users will see in their spec files for those types.

Copy link
Author

@bardisg bardisg Sep 20, 2023

Choose a reason for hiding this comment

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

will try to find some time in the near future to add the other types too

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.

2 participants