Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions vibed/web-server.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ class WebService
// ヘッダ情報<li>タグをリクエストの
// ヘッダのプロパティを調べて生成します
string[] headers;
foreach(key, value; req.headers) {
foreach(key, value;
req.headers.byKeyValue()) {
headers ~=
"<li>%s: %s</li>"
.format(key, value);
Expand All @@ -100,7 +101,7 @@ class WebService
%s
</ul>
</body>
</html>}.format(username_,
</html>}.format(username_.value,
headers.join("\n"));

res.writeBody(contents,
Expand All @@ -116,7 +117,7 @@ class WebService
</head><body>
<h1>Your name: %s</h1>
</body>
</html>}.format(username_);
</html>}.format(username);

res.writeBody(contents,
"text/html; charset=UTF-8");
Expand Down