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

Make $supportedContentEncodings publicly available or implement encoding negotiation #381

Open
MarkoNV opened this issue Dec 21, 2023 · 0 comments · May be fixed by #394
Open

Make $supportedContentEncodings publicly available or implement encoding negotiation #381

MarkoNV opened this issue Dec 21, 2023 · 0 comments · May be fixed by #394

Comments

@MarkoNV
Copy link

MarkoNV commented Dec 21, 2023

This is feature request:

Minishlink\WebPush\Subscription in constructor checks $contentEncoding against local variable. That prevents setting unsupported value, but there is no way for developer to easily find encoding which is supported by both browser and library.

Some developers still use default value 'aesgcm', other pass first supported encoding if browser supports PushManager.supportedContentEncodings. In first case, code will fail if some browser drop support for 'aesgcm' and in second case, it will fail if browser implement and prefer new encoding.

I have two possible solutions for this:
1.) Make it protected/private property with public getter. That way, developer can make encoding negotiation with browser externally.

2.) Make negotiation internally in constructor (which would require changing signature) or in create() method by accepting array of encodings, taking first supported one from array.

P.S. Sorry for closing and reopening, I missclicked submit, so closed while completing text.

@MarkoNV MarkoNV closed this as completed Dec 21, 2023
@MarkoNV MarkoNV reopened this Dec 21, 2023
@MarkoNV MarkoNV changed the title contentEncoding Make $supportedContentEncodings publicly available or implement encoding negotiation Dec 21, 2023
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 a pull request may close this issue.

1 participant