gecko-dev/services/common
Gregory Szorc 8ea5c183d9 Bug 1055102 - Properly handle Unicode in Bagheera payloads; r=bsmedberg
It was observed that FHR was sending invalid JSON payloads to the
server. Specifically, JSON payloads contained invalid Unicode strings.

Investigation revealed that the culprint was CommonUtils.convertString()
silently swallowing high bytes. When the Bagheera client went to gzip
the JSON payload, the input buffer into gzip was missing high bytes.

This patch changes the bagheera client to UTF-8 encode strings before
gzip, thus ensuring all data is preserved. A corresponding change was
also added to the mock bagheera server implementation.

Alternatively, we could have changed CommonUtils.convertString() to
be high byte aware. However, many consumers rely on this function.
This patch is written with the intent of being uplifted and the change
performed is targeted at the specific problem.

Tests for Unicode preserving behavior have been added to both the
generic Bagheera client and to FHR. The latter test is arguably
not necessary, but peace of mind is a good thing, especially with
FHR.

See also bug 915850.

--HG--
extra : rebase_source : 4efddea7767c2e5f8cf19df247c3aba07c40eec6
extra : amend_source : ae3b6d89efa54fc9ed1794404476622946ad4b22
2014-08-19 09:12:12 -07:00
..
modules-testing Bug 1055102 - Properly handle Unicode in Bagheera payloads; r=bsmedberg 2014-08-19 09:12:12 -07:00
tests Bug 1055102 - Properly handle Unicode in Bagheera payloads; r=bsmedberg 2014-08-19 09:12:12 -07:00
async.js Bug 1010531 - Prevent async callback from throwing when a callback is made with an error. r=rnewman 2014-05-28 10:00:00 +10:00
bagheeraclient.js Bug 1055102 - Properly handle Unicode in Bagheera payloads; r=bsmedberg 2014-08-19 09:12:12 -07:00
hawkclient.js Bug 1020859 Part 1 - Make HawkClient return all the response details for a request, and make deriveHawkCredentials common code. r=jparsons 2014-06-18 10:42:15 +01:00
hawkrequest.js Bug 1027595 - TypeError: deriveHawkCredentials is not a function after bug 1020859. r=jedp 2014-06-21 07:43:39 +01:00
Makefile.in Bug 1045617 - move services's run_server.py Makefile rules into mach; r=gps 2014-07-30 15:44:13 -04:00
moz.build Bug 1054476 - move INSTALL_TARGETS in services/ Makefiles to EXTRA_{PP_,}JS_MODULES; r=gps 2014-07-28 15:24:01 -04:00
observers.js Bug 836177 - Temporarily merge more JSMs to mitigate compartment overhead; r=rnewman 2013-01-30 07:07:22 -08:00
rest.js Bug 974990 - hawk request to access lang prefs as infrequently as possible. r=rnewman 2014-02-25 09:19:47 -08:00
services-common.js
servicesComponents.manifest Bug 827303 - Firefox core and crypto services components assume services/sync is built. Move registrations out of services/sync. r=gps 2013-01-10 22:02:38 +00:00
storageservice.js Bug 451283 - Move log4moz.js to Toolkit as Log.jsm. r=gps,Mossop 2013-08-26 11:55:58 -07:00
stringbundle.js Bug 798491: Add an option to stick all chrome JSMs/JS components in the same compartment. r=mrbkap,philikon 2012-10-31 09:13:28 -07:00
tokenserverclient.js Bug 990834 (part 2) - Add support/tweak retry and backoff header support to hawk and tokenserverclient. r=rnewman 2014-04-10 12:08:19 +10:00
utils.js Bug 1015794 - use Object.create to create services timer objects. r=rnewman 2014-06-12 10:06:47 +10:00