logic bug in RequestsUrlReader means read_compressed is always used.

Bug #1797403 reported by Scott Moser
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
simplestreams
Confirmed
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)
Changed in simplestreams:
status: New → Confirmed
importance: Undecided → Medium
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.