Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Make $supportedContentEncodings publicly available or implement encoding negotiation

Open
#381 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
php
Domain
api, backend

Research direction

Start with Minishlink\WebPush\Subscription's constructor, its content-encoding validation, and the create() method mentioned in the request. First determine whether the project wants a public supported-encoding accessor or internal negotiation, then define how browser-provided encodings should be supplied and how the chosen behavior can be verified.

Written by the indexing model from the issue text.

Description

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.

Dominant language
PHP
Stars
1.9k
Forks
312
Avg merge
1d 15h
Merged PRs (30d)
1

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from web-push-libs/web-push-php

All issues in web-push-libs/web-push-php

Similar issues

More PHP issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.