You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fragment Redirect on Redirect {
isPermanent
newUrl
oldPath
oldUrl
page {
id
}
site {
id
hostname
port
siteName
rootPage {
id
}
isDefaultSite
}
}
query MyQuery {
redirects {
...Redirect
}
}
and data:
id | old_path | is_permanent | redirect_link | redirect_page_id | site_id | automatically_created | created_at | redirect_page_route_path
----+----------+--------------+------------------------------+------------------+---------+-----------------------+-------------------------------+--------------------------
2 | /foo/bar | t | https://example.com/foo/baz/ | | 2 | f | 2024-02-01 10:59:52.64715+00 |
1 | /quux | t | | 3 | | f | 2024-02-01 10:59:18.243172+00 |
Having thought about this some more, it seems to me that it should be OK for oldUrl to be relative - taking into account that a redirect may be "from all sites". However, it would make sense for newUrl to always be absolute - users can either select a Page to redirect to, which must belong to a site to be routable, or enter a URL, which validation prevents from being relative.
URLField is really just a CharField with validation, so it's possible that junk values exist in the database for Site.redirect_link, but that seems unlikely under normal circumstances.
Given the query:
and data:
I get results:
Note the new URL for
/quux
is relative.The text was updated successfully, but these errors were encountered: