(self)
| 201 | return self._headers |
| 202 | |
| 203 | def render_data(self) -> typing.Iterator[bytes]: |
| 204 | if isinstance(self.file, (str, bytes)): |
| 205 | yield to_bytes(self.file) |
| 206 | return |
| 207 | |
| 208 | if hasattr(self.file, class="st">"seek"): |
| 209 | try: |
| 210 | self.file.seek(0) |
| 211 | except io.UnsupportedOperation: |
| 212 | pass |
| 213 | |
| 214 | chunk = self.file.read(self.CHUNK_SIZE) |
| 215 | while chunk: |
| 216 | yield to_bytes(chunk) |
| 217 | chunk = self.file.read(self.CHUNK_SIZE) |
| 218 | |
| 219 | def render(self) -> typing.Iterator[bytes]: |
| 220 | yield self.render_headers() |