From 98a00e42c0d94cc3d655bd2166644249a6bb3906 Mon Sep 17 00:00:00 2001 From: Victor Seva Date: Tue, 12 May 2015 17:06:05 +0200 Subject: [PATCH] MT#12927 add charset utf-8 to hal+json headers Change-Id: I8f0f89d958942e9860294d4bbca11b8c047f0939 --- lib/Data/HAL.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/Data/HAL.pm b/lib/Data/HAL.pm index fe36189..696fabb 100644 --- a/lib/Data/HAL.pm +++ b/lib/Data/HAL.pm @@ -210,10 +210,12 @@ sub http_headers { if ($self->links) { if (my ($profile_link) = grep { 'profile' eq $_->relation->as_string } @{ $self->links }) { push @headers, 'Content-Type' => join_header_words( - 'application/hal+json' => undef, profile => $profile_link->href->as_string + 'application/hal+json' => undef, + profile => $profile_link->href->as_string, + charset => 'utf-8', ); } else { - push @headers, 'Content-Type' => 'application/hal+json'; + push @headers, 'Content-Type' => 'application/hal+json; charset=utf-8'; } unless(exists $params{skip_links} && $params{skip_links}) { push @headers,