Bug Description
Optimization detective can return non-ascii characters in the Link header, breaking some reverse proxies and HTTP standards.
Steps to reproduce
Example link with Hebrew chars: https://testsite.com/wp-content/uploads/2025/01/חנות-scaled.avif
If this is added to optimization detection, for example via image prioritizer, it will cause the response header of the page to include:
Link: <https://testsite.com/wp-json/>; rel="https://api.w.org/", <https://testsite.com/wp-json/wp/v2/pages/1234>; rel="alternate"; title="JSON"; type="application/json", <https://testsite.com/wp-content/uploads/2025/01/חנות-scaled.avif>; rel="preload"; fetchpriority="high"; as="image"; media="screen and (max-width: 480px)"
HTTP headers should contain only ISO-8859-1 chars and this breaks it, the url path should be encoded.
Bug Description
Optimization detective can return non-ascii characters in the Link header, breaking some reverse proxies and HTTP standards.
Steps to reproduce
Example link with Hebrew chars:
https://testsite.com/wp-content/uploads/2025/01/חנות-scaled.avifIf this is added to optimization detection, for example via image prioritizer, it will cause the response header of the page to include:
HTTP headers should contain only ISO-8859-1 chars and this breaks it, the url path should be encoded.