ioggstream / draft-polli-resource-digests-http

THIS REPO WAS MOVED TO https://github.com/httpwg/http-extensions/
https://httpwg.org/http-extensions/draft-ietf-httpbis-digest-headers.html
Other
0 stars 1 forks source link

Example for content-encoding importance #9

Closed ioggstream closed 5 years ago

ioggstream commented 5 years ago

:rfc:`7231` states that  HTTP headers and verbs alters the  payload body 
intepretation, eg.

.. gzip.compress(json.dumps(  {"a": "1"*100}  ).encode())

.. code-block:: http
   :caption: Questo è un file json compresso all'origine con gzip -
             il payload body è in base64 per leggibilità.

   POST /entries/1234 HTTP/1.1
   Content-Type: application/json
   Content-Encoding: gzip

   H4sIAItWyFwC/6tWSlSyUlAypANQqgUAREcqfG0AAAA=

.. code-block:: http
   :caption: A proxy altering the Content-Encoding, request semantic changes
             resulting - though the samei payload body -  a disordered byte-sequence

   POST /entries/1234 HTTP/1.1
   Content-Type: application/json

   H4sIAItWyFwC/6tWSlSyUlAypANQqgUAREcqfG0AAAA=
ioggstream commented 5 years ago

fixed in #12