Skip to content

Update name of client hints #19

@jonarnes

Description

@jonarnes

New names should according to spec be :

  • sec-ch-dpr
  • sec-ch-width
  • sec-ch-viewport-width

See https://github.com/imgeng/image-cdn-wordpress/blob/master/imageengine/class-imagecdn.php#L28 and https://github.com/imgeng/image-cdn-wordpress/blob/master/imageengine/class-imagecdn.php#L46

The corresponding permissions policy header (

$permissions[] = strtolower( "ch-{$hint}=(\"{$protocol}://{$host}\")" );
) should strip the sec- prefix while constructing the permissions-policy header.

The feature-policy header can be removed:

self::header( 'Feature-Policy', strtolower( implode( '; ', $features ) ) );

Acceptance criteria:

Response header accept-ch looks like this:
Accept-CH: sec-ch-width, sec-ch-viewport-width, sec-ch-dpr

Response header permissions-policy looks like this:
permissions-policy: ch-width=("<ie-delivery-address-goes-here>"),ch-viewport-width=("<ie-delivery-address-goes-here>"),ch-dpr=("<ie-delivery-address-goes-here>")

Metadata

Metadata

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