X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~yarrgweb/git?a=blobdiff_plain;f=yarrg%2Fweb%2Fqtextstringcheck;fp=yarrg%2Fweb%2Fqtextstringcheck;h=9dce8287e208d8213418dd6432e49898c998a74a;hb=c810347487961a59b3d8dfb2fed123f49dc22ed4;hp=4fbfc546a88903180506ad850ba5411b288bbaa5;hpb=a9a88c14c5a5bd057932f76ad721b5f0fc845c20;p=ypp-sc-tools.db-live.git diff --git a/yarrg/web/qtextstringcheck b/yarrg/web/qtextstringcheck index 4fbfc54..9dce828 100755 --- a/yarrg/web/qtextstringcheck +++ b/yarrg/web/qtextstringcheck @@ -129,7 +129,10 @@ $emsg='' if !defined $emsg; $debugf->("QTSC EMSG='$emsg' RESULTS='@results'"); if ($format =~ /json/) { - $r->content_type($ctype or $format); + $ctype ||= $format; + die unless grep { $_ eq $ctype } + qw(application/json text/plain text/xml); + $r->content_type($ctype); my $jobj= { success => 1*!length $emsg, show => (length $emsg ? $emsg :