summaryrefslogtreecommitdiff
path: root/test/interactive-helper/aptwebserver.cc
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2016-03-13 23:30:05 +0100
committerDavid Kalnischkies <david@kalnischkies.de>2016-03-14 11:47:19 +0100
commit12f40394b3940573c0e63d74722a95148fb1ad39 (patch)
treee5e97e6290b397cbe54ecdefb5ffb225db8c9c42 /test/interactive-helper/aptwebserver.cc
parent4a808deaac462e7714a345dac676c6da294a2ee0 (diff)
aptwebserver: fix html validation issues
Iceweasel^WFirefox complains about the missing encoding in its console which can be a bit annoying in interactive sessions, so fixing these issues has no effect on apt itself, but on the testers. Git-Dch: Ignore
Diffstat (limited to 'test/interactive-helper/aptwebserver.cc')
-rw-r--r--test/interactive-helper/aptwebserver.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/test/interactive-helper/aptwebserver.cc b/test/interactive-helper/aptwebserver.cc
index 0398a4599..98db8982e 100644
--- a/test/interactive-helper/aptwebserver.cc
+++ b/test/interactive-helper/aptwebserver.cc
@@ -209,8 +209,8 @@ static bool sendData(int const client, std::list<std::string> const &headers, st
static void sendError(int const client, int const httpcode, std::string const &request,/*{{{*/
bool const content, std::string const &error, std::list<std::string> &headers)
{
- std::string response("<html><head><title>");
- response.append(httpcodeToStr(httpcode)).append("</title></head>");
+ std::string response("<!doctype html><html><head><title>");
+ response.append(httpcodeToStr(httpcode)).append("</title><meta charset=\"utf-8\" /></head>");
response.append("<body><h1>").append(httpcodeToStr(httpcode)).append("</h1>");
if (httpcode != 200)
response.append("<p><em>Error</em>: ");
@@ -245,8 +245,8 @@ static void sendRedirect(int const client, int const httpcode, std::string const
std::string const &request, bool content)
{
std::list<std::string> headers;
- std::string response("<html><head><title>");
- response.append(httpcodeToStr(httpcode)).append("</title></head>");
+ std::string response("<!doctype html><html><head><title>");
+ response.append(httpcodeToStr(httpcode)).append("</title><meta charset=\"utf-8\" /></head>");
response.append("<body><h1>").append(httpcodeToStr(httpcode)).append("</h1");
response.append("<p>You should be redirected to <em>").append(uri).append("</em></p>");
response.append("This page is a result of the request: <pre>");
@@ -332,7 +332,7 @@ static void sendDirectoryListing(int const client, std::string const &dir,/*{{{*
return;
}
- listing << "<html><head><title>Index of " << dir << "</title>"
+ listing << "<!doctype html><html><head><title>Index of " << dir << "</title><meta charset=\"utf-8\" />"
<< "<style type=\"text/css\"><!-- td {padding: 0.02em 0.5em 0.02em 0.5em;}"
<< "tr:nth-child(even){background-color:#dfdfdf;}"
<< "h1, td:nth-child(3){text-align:center;}"