[PATCH] Bugfix in errors/*.pl and opac/errors/*.pl

Sébastien Hinderer Sebastien.Hinderer at ens-lyon.org
Sun Nov 1 01:04:19 CET 2009


The scripts did not define the status printed on the first line of
HTTP headers correctly: they were sending 200 OK,
which was confusing for browsers.
---
 errors/400.pl      |    2 +-
 errors/401.pl      |    2 +-
 errors/402.pl      |    2 +-
 errors/403.pl      |    2 +-
 errors/404.pl      |    2 +-
 errors/500.pl      |    2 +-
 opac/errors/400.pl |    2 +-
 opac/errors/401.pl |    2 +-
 opac/errors/402.pl |    2 +-
 opac/errors/403.pl |    2 +-
 opac/errors/404.pl |    2 +-
 opac/errors/500.pl |    2 +-
 12 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/errors/400.pl b/errors/400.pl
index 431792b..b04b7fd 100755
--- a/errors/400.pl
+++ b/errors/400.pl
@@ -34,4 +34,4 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
     }
 );
 $template->param( admin => $admin );
-output_html_with_http_headers $query, $cookie, $template->output;
+output_with_http_headers $query, $cookie, $template->output, 'html', '400 Bad Request';
diff --git a/errors/401.pl b/errors/401.pl
index 9374765..3ea459a 100755
--- a/errors/401.pl
+++ b/errors/401.pl
@@ -34,4 +34,4 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
     }
 );
 $template->param( admin => $admin );
-output_html_with_http_headers $query, $cookie, $template->output;
+output_with_http_headers $query, $cookie, $template->output, 'html', '401 Unauthorized';
diff --git a/errors/402.pl b/errors/402.pl
index c7f6641..4bfe7ce 100755
--- a/errors/402.pl
+++ b/errors/402.pl
@@ -34,4 +34,4 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
     }
 );
 $template->param( admin => $admin );
-output_html_with_http_headers $query, $cookie, $template->output;
+output_with_http_headers $query, $cookie, $template->output, 'html', '402 Payment Required';
diff --git a/errors/403.pl b/errors/403.pl
index b6ffe0d..4058ce9 100755
--- a/errors/403.pl
+++ b/errors/403.pl
@@ -34,4 +34,4 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
     }
 );
 $template->param( admin => $admin );
-output_html_with_http_headers $query, $cookie, $template->output;
+output_with_http_headers $query, $cookie, $template->output, 'html', '403 Forbidden';
diff --git a/errors/404.pl b/errors/404.pl
index ee0fb2a..418723f 100755
--- a/errors/404.pl
+++ b/errors/404.pl
@@ -34,4 +34,4 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
     }
 );
 $template->param( admin => $admin );
-output_html_with_http_headers $query, $cookie, $template->output;
+output_with_http_headers $query, $cookie, $template->output, 'html', '404 Not Found';
diff --git a/errors/500.pl b/errors/500.pl
index f4341ed..6f570a2 100755
--- a/errors/500.pl
+++ b/errors/500.pl
@@ -34,4 +34,4 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
     }
 );
 $template->param( admin => $admin );
-output_html_with_http_headers $query, $cookie, $template->output;
+output_with_http_headers $query, $cookie, $template->output, 'html', '500 Internal Server Error';
diff --git a/opac/errors/400.pl b/opac/errors/400.pl
index 16c169c..a0d9413 100755
--- a/opac/errors/400.pl
+++ b/opac/errors/400.pl
@@ -34,4 +34,4 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
     }
 );
 $template->param( admin => $admin );
-output_html_with_http_headers $query, $cookie, $template->output;
+output_with_http_headers $query, $cookie, $template->output, 'html', '400 Bad Request';
diff --git a/opac/errors/401.pl b/opac/errors/401.pl
index c6573f4..216b643 100755
--- a/opac/errors/401.pl
+++ b/opac/errors/401.pl
@@ -34,4 +34,4 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
     }
 );
 $template->param( admin => $admin );
-output_html_with_http_headers $query, $cookie, $template->output;
+output_with_http_headers $query, $cookie, $template->output, 'html', '401 Unauthorized';
diff --git a/opac/errors/402.pl b/opac/errors/402.pl
index 8620f88..b84ccca 100755
--- a/opac/errors/402.pl
+++ b/opac/errors/402.pl
@@ -34,4 +34,4 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
     }
 );
 $template->param( admin => $admin );
-output_html_with_http_headers $query, $cookie, $template->output;
+output_with_http_headers $query, $cookie, $template->output, 'html', '402 Payment Required';
diff --git a/opac/errors/403.pl b/opac/errors/403.pl
index d223ffb..ba21cd6 100755
--- a/opac/errors/403.pl
+++ b/opac/errors/403.pl
@@ -34,4 +34,4 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
     }
 );
 $template->param( admin => $admin );
-output_html_with_http_headers $query, $cookie, $template->output;
+output_with_http_headers $query, $cookie, $template->output, 'html', '403 Forbidden';
diff --git a/opac/errors/404.pl b/opac/errors/404.pl
index 0c5408c..ad81428 100755
--- a/opac/errors/404.pl
+++ b/opac/errors/404.pl
@@ -34,4 +34,4 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
     }
 );
 $template->param( admin => $admin );
-output_html_with_http_headers $query, $cookie, $template->output;
+output_with_http_headers $query, $cookie, $template->output, 'html', '404 Not Found';
diff --git a/opac/errors/500.pl b/opac/errors/500.pl
index d3c5ce1..fb0350e 100755
--- a/opac/errors/500.pl
+++ b/opac/errors/500.pl
@@ -34,4 +34,4 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
     }
 );
 $template->param( admin => $admin );
-output_html_with_http_headers $query, $cookie, $template->output;
+output_with_http_headers $query, $cookie, $template->output, 'html', '500 Internal Server Error';
-- 
1.6.5


--WIyZ46R2i8wDzkSu--


More information about the Koha-patches mailing list