logic bug in RequestsUrlReader means read_compressed is always used.

Bug #1797403 reported by Scott Moser on 2018-10-11
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
simplestreams
Medium
Unassigned

Bug Description

RequestsUrlReader has this blob of code in its __init__
        ce = self.req.headers.get('content-encoding', '').lower()
        if 'gzip' in ce or 'deflate' in ce:
            self._read = self.read_compressed
        else:
            self._read = self.read_raw

That if statement will always take the rad_compressed route
because bool('gzip') will always return true.

So we really needed:

if 'gzip' in ce or 'deflate' in ce:
    ...

Scott Moser (smoser) on 2018-10-11
Changed in simplestreams:
status: New → Confirmed
importance: Undecided → Medium
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers