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

fix: support custom url protocol scheme on websockets #1173

Merged
merged 2 commits into from
Feb 29, 2024

Conversation

ilyaGurevich
Copy link
Contributor

@ilyaGurevich ilyaGurevich commented Feb 28, 2024

Custom url protocol schemes are not supported in sockjs, this allows you to render kyt-generated content locally in custom URL patterns by using a web-socket connection instead.

})
);
let connection;
if (!window.location.protocol.includes('http')) {
Copy link

Choose a reason for hiding this comment

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

Can this protocol be https?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If you're https then the .includes will also match with https

Copy link
Contributor Author

Choose a reason for hiding this comment

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

const protocol = 'https:'
protocol.includes('http') --> true

Copy link

Choose a reason for hiding this comment

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

Oh that's right 👍

Copy link

@kmnaid kmnaid Feb 28, 2024

Choose a reason for hiding this comment

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

For security, should we just have includes http OR https instead of keeping it open to any value with http?

@ilyaGurevich ilyaGurevich merged commit 9d0dbf5 into main Feb 29, 2024
5 checks passed
@ilyaGurevich ilyaGurevich deleted the support-custom-protocol branch February 29, 2024 19:13
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.

3 participants