summaryrefslogtreecommitdiff
path: root/IkiWiki
diff options
context:
space:
mode:
authorJoey Hess <joey@kitenet.net>2010-09-19 20:15:34 -0400
committerJoey Hess <joey@kitenet.net>2010-09-19 20:15:34 -0400
commit8063b960ade41a089d859b655ff26fb61fb18d3f (patch)
tree8292f3caaced00545d21949da2fe81349bfa592a /IkiWiki
parent2ca4ff8ae6d2d528b8895f7907d74c2f8859dc8d (diff)
meta: Ensure that the url specified by xrds-location is absolute.
With a relative xrds-location, the openid perl client module will fail. I haven't checked the specs to see if it needs to be absolute, but all examples I've seen are absolute, so it seems a very good idea.
Diffstat (limited to 'IkiWiki')
-rw-r--r--IkiWiki/Plugin/meta.pm6
1 files changed, 5 insertions, 1 deletions
diff --git a/IkiWiki/Plugin/meta.pm b/IkiWiki/Plugin/meta.pm
index ae593555e..5cfa72833 100644
--- a/IkiWiki/Plugin/meta.pm
+++ b/IkiWiki/Plugin/meta.pm
@@ -198,8 +198,12 @@ sub preprocess (@) {
'" rel="openid2.local_id" />' if $delegate ne 1;
}
if (exists $params{"xrds-location"} && safeurl($params{"xrds-location"})) {
+ # force url absolute
+ eval q{use URI};
+ error($@) if $@;
+ my $url=URI->new_abs($params{"xrds-location"}, $config{url});
push @{$metaheaders{$page}}, '<meta http-equiv="X-XRDS-Location" '.
- 'content="'.encode_entities($params{"xrds-location"}).'" />';
+ 'content="'.encode_entities($url).'" />';
}
}
elsif ($key eq 'redir') {