Save response body as binary when updating cache

Review Request #7098 — Created March 21, 2015 and submitted

Information

RBTools
release-0.7.x
0181363...

Reviewers

In the HTTP cache for the API, the response_body field is marked as a
BLOB field and can contain arbitrary data. Previously when a cache entry
was updated, the content being inserted into the response_body field
was not being marked as binary, which caused issues when dealing with
diffs that had non-ASCII characters. This patch fixes that issue by
ensuring the the response body is being saved as binary when the field
is updated.

A unit test has been added to verify that non-ASCII data can be written
to the HTTP cache without error.

Ran unit tests.

Verified the supplied unit test fails without this patch applied.

reviewbot
  1. Tool: PEP8 Style Checker
    Processed Files:
        rbtools/api/tests.py
        rbtools/api/cache.py
    
    
    
    Tool: Pyflakes
    Processed Files:
        rbtools/api/tests.py
        rbtools/api/cache.py
    
    
  2. 
      
gmyers
  1. Ship It!
  2. 
      
brennie
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-0.7.x (e5a9cfb)
Loading...