From f2657bd9d6453fea9227d48ffa639a7d3be11ba3 Mon Sep 17 00:00:00 2001 From: Julian Maurice Date: Wed, 24 Jun 2015 09:47:49 +0200 Subject: [PATCH] Bug 13799: 3. Force UTF-8 charset in responses --- Koha/REST/V1.pm | 5 ++++- api/v1/script.cgi | 0 2 files changed, 4 insertions(+), 1 deletion(-) mode change 100644 => 100755 api/v1/script.cgi diff --git a/Koha/REST/V1.pm b/Koha/REST/V1.pm index 64f91b5..746910a 100644 --- a/Koha/REST/V1.pm +++ b/Koha/REST/V1.pm @@ -68,6 +68,9 @@ sub startup { } ); + # Force charset=utf8 in Content-Type header for JSON responses + $self->types->type(json => 'application/json; charset=utf8'); + $self->plugin(Swagger2 => { route => $route, url => $self->home->rel_file("api/v1/swagger.json"), @@ -105,4 +108,4 @@ sub setKohaParamLogging { print __PACKAGE__."::startup():> No logfile given, defaulting to STDERR. Define your logfile and loglevel to the MOJO_LOGFILES and MOJO_LOGLEVEL environmental variables. If you want foreground logging, set the MOJO_LOGFILES as undef.\n"; } } -1; \ No newline at end of file +1; diff --git a/api/v1/script.cgi b/api/v1/script.cgi old mode 100644 new mode 100755 -- 1.9.1