summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/TUWF/Response.pm4
-rw-r--r--lib/TUWF/Response.pod4
2 files changed, 4 insertions, 4 deletions
diff --git a/lib/TUWF/Response.pm b/lib/TUWF/Response.pm
index aa78efb..34754e8 100644
--- a/lib/TUWF/Response.pm
+++ b/lib/TUWF/Response.pm
@@ -163,7 +163,7 @@ sub resStatus {
}
-# Redirect to an other page, accepts an URL (relative to current hostname) and
+# Redirect to an other page, accepts an URL (either relative or absolute) and
# an optional type consisting of 'temp' (temporary) or 'post' (after posting a form).
# No type argument means a permanent redirect.
sub resRedirect {
@@ -173,7 +173,7 @@ sub resRedirect {
my $fd = $self->resFd();
print $fd 'Redirecting...';
$self->resHeader('Content-Type' => 'text/plain');
- $self->resHeader('Location' => $self->reqBaseURI().$url);
+ $self->resHeader('Location' => $url);
$self->resStatus(!$type ? 301 : $type eq 'temp' ? 307 : 303);
}
diff --git a/lib/TUWF/Response.pod b/lib/TUWF/Response.pod
index 20d8261..fab404c 100644
--- a/lib/TUWF/Response.pod
+++ b/lib/TUWF/Response.pod
@@ -161,8 +161,8 @@ Gets or sets the numeric HTTP response status code.
=head2 resRedirect(location, type)
-Generate a HTTP redirect to I<location>, which should be a path relative to the
-domain, including leading a slash. If I<type> is not defined, a 301 (Moved
+Generate a HTTP redirect to I<location>, which should be an absolute URL or a
+path relative to the current domain. If I<type> is not defined, a 301 (Moved
Permanently) is used. If I<type> is 'temp', a 307 (Temporary Redirect) or if
I<type> is 'post' a 303 (See Other) status code is used. The latter is
recommended for use as response to a POST request, as it explicitely tells the