From e92017500ededebba9ab5df21c6c134ddb2aa512 Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Sun, 26 Oct 2008 04:11:47 +0000 Subject: [PATCH] change mime type of json methods from text/json to application/json --- docs/changelog/7.x.x.txt | 1 + lib/WebGUI/Asset/Wobject/EventManagementSystem.pm | 12 ++++++------ lib/WebGUI/Asset/Wobject/Gallery.pm | 4 ++-- lib/WebGUI/Asset/Wobject/GalleryAlbum.pm | 2 +- lib/WebGUI/Content/AssetDiscovery.pm | 2 +- lib/WebGUI/Operation/Spectre.pm | 2 +- lib/WebGUI/Shop/Tax.pm | 2 +- lib/WebGUI/Shop/Transaction.pm | 2 +- 8 files changed, 14 insertions(+), 13 deletions(-) diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 8cbd5bff7..574a63584 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -34,6 +34,7 @@ - added: TextArea now supports "maxlength" attribute - added: DataForm can now run a workflow when an entry is added - Fixed #8921: Duplicating templates through conventional methods maintains default template flag + - Fixed #8962: Wrong mime-type used for json data 7.6.1 - changed: the list of extensions for the export system to pass through diff --git a/lib/WebGUI/Asset/Wobject/EventManagementSystem.pm b/lib/WebGUI/Asset/Wobject/EventManagementSystem.pm index 3ab4f3a22..5be779f33 100644 --- a/lib/WebGUI/Asset/Wobject/EventManagementSystem.pm +++ b/lib/WebGUI/Asset/Wobject/EventManagementSystem.pm @@ -821,7 +821,7 @@ sub www_getBadgesAsJson { $results{'startIndex'} = 0; $results{'sort'} = undef; $results{'dir'} = "asc"; - $session->http->setMimeType('text/json'); + $session->http->setMimeType('application/json'); return JSON->new->utf8->encode(\%results); } @@ -838,7 +838,7 @@ sub www_getRegistrantAsJson { my $session = $self->session; my $db = $session->db; return $session->privilege->insufficient() unless $self->canView; - $session->http->setMimeType('text/json'); + $session->http->setMimeType('application/json'); my @tickets = (); my @tokens = (); my @ribbons = (); @@ -1017,7 +1017,7 @@ sub www_getRegistrantsAsJson { $results{'dir'} = "asc"; # build json datasource - $session->http->setMimeType('text/json'); + $session->http->setMimeType('application/json'); return JSON->new->utf8->encode(\%results); } @@ -1052,7 +1052,7 @@ sub www_getRibbonsAsJson { $results{'startIndex'} = 0; $results{'sort'} = undef; $results{'dir'} = "asc"; - $session->http->setMimeType('text/json'); + $session->http->setMimeType('application/json'); return JSON->new->utf8->encode(\%results); } @@ -1204,7 +1204,7 @@ className='WebGUI::Asset::Sku::EMSTicket' and state='published' and revisionDate $results{'startIndex'} = $startIndex; $results{'sort'} = undef; $results{'dir'} = "asc"; - $session->http->setMimeType('text/json'); + $session->http->setMimeType('application/json'); return JSON->new->utf8->encode(\%results); } @@ -1239,7 +1239,7 @@ sub www_getTokensAsJson { $results{'startIndex'} = 0; $results{'sort'} = undef; $results{'dir'} = "asc"; - $session->http->setMimeType('text/json'); + $session->http->setMimeType('application/json'); return JSON->new->utf8->encode(\%results); } diff --git a/lib/WebGUI/Asset/Wobject/Gallery.pm b/lib/WebGUI/Asset/Wobject/Gallery.pm index 6f8ccc043..3971e765b 100644 --- a/lib/WebGUI/Asset/Wobject/Gallery.pm +++ b/lib/WebGUI/Asset/Wobject/Gallery.pm @@ -1122,7 +1122,7 @@ sub www_addAlbumService { return XML::Simple::XMLout($document, NoAttr => 1); } - $session->http->setMimeType('text/json'); + $session->http->setMimeType('application/json'); return JSON->new->pretty->encode($document); } @@ -1315,7 +1315,7 @@ sub www_listAlbumsService { $session->http->setMimeType('text/xml'); return XML::Simple::XMLout($document, NoAttr => 1); } - $session->http->setMimeType('text/json'); + $session->http->setMimeType('application/json'); return JSON->new->pretty->encode($document); } diff --git a/lib/WebGUI/Asset/Wobject/GalleryAlbum.pm b/lib/WebGUI/Asset/Wobject/GalleryAlbum.pm index d0d8cbded..9168b2beb 100644 --- a/lib/WebGUI/Asset/Wobject/GalleryAlbum.pm +++ b/lib/WebGUI/Asset/Wobject/GalleryAlbum.pm @@ -988,7 +988,7 @@ sub www_addFileService { return XML::Simple::XMLout($document, NoAttr => 1); } - $session->http->setMimeType('text/json'); + $session->http->setMimeType('application/json'); return JSON->new->pretty->encode($document); } diff --git a/lib/WebGUI/Content/AssetDiscovery.pm b/lib/WebGUI/Content/AssetDiscovery.pm index 28bc9556e..951d49e4e 100644 --- a/lib/WebGUI/Content/AssetDiscovery.pm +++ b/lib/WebGUI/Content/AssetDiscovery.pm @@ -138,7 +138,7 @@ sub handler { $session->http->setMimeType('text/xml'); return XML::Simple::XMLout($document, NoAttr => 1); } - $session->http->setMimeType('text/json'); + $session->http->setMimeType('application/json'); return JSON->new->encode($document); } return undef; diff --git a/lib/WebGUI/Operation/Spectre.pm b/lib/WebGUI/Operation/Spectre.pm index 5a35b789f..f33e04e19 100644 --- a/lib/WebGUI/Operation/Spectre.pm +++ b/lib/WebGUI/Operation/Spectre.pm @@ -52,7 +52,7 @@ Checks to ensure the requestor is who we think it is, and then returns a JSON st sub www_spectreGetSiteData { my $session = shift; - $session->http->setMimeType("text/json"); + $session->http->setMimeType("application/json"); $session->http->setCacheControl("none"); my %siteData = (); my $subnets = $session->config->get("spectreSubnets"); diff --git a/lib/WebGUI/Shop/Tax.pm b/lib/WebGUI/Shop/Tax.pm index 111cbbb0d..14071e2d1 100644 --- a/lib/WebGUI/Shop/Tax.pm +++ b/lib/WebGUI/Shop/Tax.pm @@ -478,7 +478,7 @@ sub www_getTaxesAsJson { $results{'startIndex'} = $startIndex; $results{'sort'} = undef; $results{'dir'} = $sortDir; - $session->http->setMimeType('text/json'); + $session->http->setMimeType('application/json'); return JSON::to_json(\%results); } diff --git a/lib/WebGUI/Shop/Transaction.pm b/lib/WebGUI/Shop/Transaction.pm index caf3122a8..f9599cacd 100644 --- a/lib/WebGUI/Shop/Transaction.pm +++ b/lib/WebGUI/Shop/Transaction.pm @@ -700,7 +700,7 @@ sub www_getTransactionsAsJson { $results{'startIndex'} = $startIndex; $results{'sort'} = undef; $results{'dir'} = "desc"; - $session->http->setMimeType('text/json'); + $session->http->setMimeType('application/json'); return JSON->new->utf8->encode(\%results); }