Skip to content

Make $supportedContentEncodings publicly available or implement encoding negotiation #381

Open
@MarkoNV

Description

@MarkoNV

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions