From 8063b960ade41a089d859b655ff26fb61fb18d3f Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 19 Sep 2010 20:15:34 -0400 Subject: [PATCH] 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. --- IkiWiki/Plugin/meta.pm | 6 +++++- debian/changelog | 6 ++++++ 2 files changed, 11 insertions(+), 1 deletion(-) 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}}, ''; + 'content="'.encode_entities($url).'" />'; } } elsif ($key eq 'redir') { diff --git a/debian/changelog b/debian/changelog index 8286b7887..24115c177 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +ikiwiki (3.20100916) UNRELEASED; urgency=low + + * meta: Ensure that the url specified by xrds-location is absolute. + + -- Joey Hess Sun, 19 Sep 2010 20:13:06 -0400 + ikiwiki (3.20100915) unstable; urgency=low * needsbuild hook interface changed; the hooks should now return -- 2.39.5