Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(resolve-metadata): allow for search params in canonical URL (verc…
…el#65366) When `alternates.canonical` is provided as a `URL` instance, `searchParams` are discarded. When canonical is provided as a string, the same search parameters work. This behavior may be unintuitive. #### Unexpected result (`foo=bar` is removed): ```ts export const generateMetadata = () => { const canonical = new URL(`https://example.com/test?foo=bar`); return { alternates: { canonical: canonical }, }; }; ``` #### Works as expected: ```ts export const generateMetadata = () => { const canonical = new URL(`https://example.com/test?foo=bar`); return { alternates: { canonical: canonical.toString() }, }; }; ``` Co-authored-by: Shu Ding <[email protected]> Co-authored-by: JJ Kasper <[email protected]>
- Loading branch information