sanic/sanic
Harsha Narayana d4d1df03c9
fix content length mismatch in windows and other platform
The current implementation of `sanic` attempts to make use of `ujson` if
it's available in the system and if not, it will default to the inbuilt
`json` module provided by python.

The current implementation of `ujson` does not provide a mechanism to
provide a custom `seperators` parameter as part of the `dumps` method
invocation and the default behavior of the module is to strip all the
spaces around seperators such as `:` and `,`. This leads to an
inconsistency in the response length when the response is generated
using the `ujson` and in built `json` module provided by python.

To maintain the consistency, this commit overrides the default behavior
of the `dumps` method provided by the `json` module to add a `seperators`
argument that will strip the white spaces around these character like
the default behavior of `ujson`

This addresses the issue referenced in #1398

Signed-off-by: Harsha Narayana <harsha2k4@gmail.com>
2018-11-07 21:38:32 +05:30
..
__init__.py integrate with isort 2018-10-17 21:20:16 -07:00
__main__.py Fix documentation build errors 2018-10-26 11:57:28 +03:00
app.py Indentation fix 2018-11-01 10:59:45 -06:00
blueprints.py Fix pickling blueprints 2018-11-04 15:04:12 +10:00
config.py run black against sanic module 2018-10-13 17:55:33 -07:00
constants.py run black against sanic module 2018-10-13 17:55:33 -07:00
cookies.py Fix documentation build errors 2018-10-26 11:57:28 +03:00
exceptions.py integrate with isort 2018-10-17 21:20:16 -07:00
handlers.py fix Range header handling for static files (#1402) 2018-11-07 07:36:56 -06:00
helpers.py run black against sanic module 2018-10-13 17:55:33 -07:00
log.py fix the logger and make it work (#1397) 2018-11-06 08:39:38 -06:00
reloader_helpers.py integrate with isort 2018-10-17 21:20:16 -07:00
request.py Removed unnecessary changes to request and router files, changes to fix lint test 2018-11-01 10:53:53 -06:00
response.py fix content length mismatch in windows and other platform 2018-11-07 21:38:32 +05:30
router.py Removed unnecessary changes to request and router files, changes to fix lint test 2018-11-01 10:53:53 -06:00
server.py integrate with isort 2018-10-17 21:20:16 -07:00
static.py integrate with isort 2018-10-17 21:20:16 -07:00
testing.py Fix documentation build errors 2018-10-26 11:57:28 +03:00
views.py integrate with isort 2018-10-17 21:20:16 -07:00
websocket.py integrate with isort 2018-10-17 21:20:16 -07:00
worker.py integrate with isort 2018-10-17 21:20:16 -07:00