Skip to content

Commit 43f4c47

Browse files
committed
xml+atom だった時に、charset utf-8にする
1 parent d5268f1 commit 43f4c47

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Diff for: script/app.psgi

+10
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,15 @@ builder {
66
s!/([^\.]+)$!/$1/!;
77
s!(.*/$)!$1/index.html! or return qr{^/.+};
88
},
9+
content_type => sub {
10+
my $file = shift;
11+
my $content_type = Plack::MIME->mime_type($file) || 'text/plain';
12+
13+
if ($content_type eq 'application/atom+xml') {
14+
$content_type .= "; charset=utf-8";
15+
}
16+
17+
return $content_type;
18+
},
919
root => './public/';
1020
};

0 commit comments

Comments
 (0)