Set request content encoding.
(self)
| 231 | self.headers[hdrs.COOKIE] = c.output(header='', sep=';').strip() |
| 232 | |
| 233 | def update_content_encoding(self): |
| 234 | """Set request content encoding.""" |
| 235 | enc = self.headers.get(hdrs.CONTENT_ENCODING, '').lower() |
| 236 | if enc: |
| 237 | if self.compress is not False: |
| 238 | self.compress = enc |
| 239 | # enable chunked, no need to deal with length |
| 240 | self.chunked = True |
| 241 | elif self.compress: |
| 242 | if not isinstance(self.compress, str): |
| 243 | self.compress = 'deflate' |
| 244 | self.headers[hdrs.CONTENT_ENCODING] = self.compress |
| 245 | self.chunked = True # enable chunked, no need to deal with length |
| 246 | |
| 247 | def update_auth(self, auth): |
| 248 | """Set basic auth.""" |