-
Notifications
You must be signed in to change notification settings - Fork 26.1k
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 (#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 <g@shud.in> Co-authored-by: JJ Kasper <jj@jjsweb.site>
- Loading branch information
1 parent
359fdb2
commit e2f579e
Showing
2 changed files
with
83 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters