summaryrefslogtreecommitdiff
path: root/lib/VNDB/Handler/Misc.pm
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2014-10-21 09:53:53 +0200
committerYorhel <git@yorhel.nl>2014-10-21 09:53:53 +0200
commit20805809f42d8fa152aca46d0b737e90b308092a (patch)
tree6ef0b87fc96b26f6f1678501a9cb2e390808b4f8 /lib/VNDB/Handler/Misc.pm
parent57022acc845a1502e4e42a322d48567b9afe7f02 (diff)
Use TUWF's reqBaseURI() instead of $self->{uri} on site links
TUWF properly detects HTTPS and includes this in the returned URL, so this change ensures that all URLs adopt properly to HTTP and HTTPS.
Diffstat (limited to 'lib/VNDB/Handler/Misc.pm')
-rw-r--r--lib/VNDB/Handler/Misc.pm12
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/VNDB/Handler/Misc.pm b/lib/VNDB/Handler/Misc.pm
index d801c667..357779bc 100644
--- a/lib/VNDB/Handler/Misc.pm
+++ b/lib/VNDB/Handler/Misc.pm
@@ -350,7 +350,8 @@ sub setlang {
my $browser = VNDB::L10N->get_handle()->language_tag();
- (my $ref = $self->reqHeader('Referer')||'/') =~ s/^\Q$self->{url}//;
+ my $b = $self->reqBaseURI();
+ (my $ref = $self->reqHeader('Referer')||'/') =~ s/^\Q$b//;
$self->resRedirect($ref, 'post');
if($lang ne $self->{l10n}->language_tag()) {
$self->authInfo->{id}
@@ -396,6 +397,7 @@ sub prefs {
sub opensearch {
my $self = shift;
+ my $h = $self->reqBaseURI();
$self->resHeader('Content-Type' => 'application/opensearchdescription+xml');
xml;
tag 'OpenSearchDescription',
@@ -403,12 +405,12 @@ sub opensearch {
tag 'ShortName', 'VNDB';
tag 'LongName', 'VNDB.org visual novel search';
tag 'Description', 'Search visual vovels on VNDB.org';
- tag 'Image', width => 16, height => 16, type => 'image/x-icon', $self->{url}.'/favicon.ico'
+ tag 'Image', width => 16, height => 16, type => 'image/x-icon', "$h/favicon.ico"
if -s "$VNDB::ROOT/www/favicon.ico";
- tag 'Url', type => 'text/html', method => 'get', template => $self->{url}.'/v/all?q={searchTerms}', undef;
- tag 'Url', type => 'application/opensearchdescription+xml', rel => 'self', template => $self->{url}.'/opensearch.xml', undef;
+ tag 'Url', type => 'text/html', method => 'get', template => "$h/v/all?q={searchTerms}", undef;
+ tag 'Url', type => 'application/opensearchdescription+xml', rel => 'self', template => "$h/opensearch.xml", undef;
tag 'Query', role => 'example', searchTerms => 'Tsukihime', undef;
- tag 'moz:SearchForm', $self->{url}.'/v/all';
+ tag 'moz:SearchForm', "$h/v/all";
end 'OpenSearchDescription';
}