Commit Message: - Limit the size of .well-known lookups. - This is a port of matrix-org/synapse#8950 and matrix-org/synapse#9100. - Code is simplified compared to the original port: - Type hints are removed as sydent supports Python 2.7. - The size of the response is not returned, only the bytes. Key Changes: - Added a new class to restrict the size of the HTTP response body. - Defined a maximum file size for files ( ). - Modified the function to enforce the maximum file size limit. - Exception handling for when the size limit is exceeded ( ). Context: - The changes are related to mitigating a specific vulnerability where the size of files is not validated, potentially leading to memory exhaustion or other issues. - Code adaptation for Python 2.7, simplifying some aspects of the original patch.