absolute referrer links

This commit is contained in:
Leon van Kammen 2026-11-05 15:33:30 +01:00
parent dcf90a4205
commit c083470916
3 changed files with 7 additions and 4 deletions

View file

@ -84,6 +84,7 @@ end
util.getURL = function(url,opts) util.getURL = function(url,opts)
opts = opts or {} opts = opts or {}
local port = '' local port = ''
if url and url:match("://") then return url end
if opts.server then if opts.server then
url = url or '/' url = url or '/'
return 'http://localhost:' .. app.port .. url return 'http://localhost:' .. app.port .. url

View file

@ -11,7 +11,6 @@
"virtualgamepad": "./apps/virtualgamepad/virtualgamepad.json", "virtualgamepad": "./apps/virtualgamepad/virtualgamepad.json",
"buttons": "./apps/buttons/buttons.json", "buttons": "./apps/buttons/buttons.json",
"xrmenu": "./apps/xrmenu/xrmenu.json?v=14", "xrmenu": "./apps/xrmenu/xrmenu.json?v=14",
"xrfragment": "./apps/xrfragment/xrfragment.json",
"xrforge": "./apps/xrforge/xrforge.json", "xrforge": "./apps/xrforge/xrforge.json",
"vfs": "./apps/vfs/vfs.json" "vfs": "./apps/vfs/vfs.json"
}, },

View file

@ -56,9 +56,9 @@ return {
res.parent = parent res.parent = parent
end end
if isroot then if isroot then
referrer = app.opts.plugin_federation_parent_url referrer = util.getURL( app.opts.plugin_federation_parent_url )
else else
referrer = v.parent.parent.url referrer = util.getURL( v.parent.parent.url )
end end
end end
end end
@ -97,7 +97,10 @@ return {
and not isMarkupExperience(data.item)) and not isMarkupExperience(data.item))
then then
-- update referrer url -- update referrer url
data.referrer = util.baseURLify(v.view3D and (v.parent.parent and v.parent.parent.url) or v.parent.url) data.referrer = util.getURL(
util.baseURLify(v.view3D and (v.parent.parent and v.parent.parent.url) or v.parent.url)
)
data.item = v data.item = v
data.title = data.item.title data.title = data.item.title
data.parent = v.parent data.parent = v.parent