nl: and string 'ascii' and call the function to_bytes with 2 arguments: value and string 'latin-1', join the previous 2 results into a string, separated by ': ', append it to a list, substitute the resulting list for headers. join headers into a string, separated by string '\r\n'.
code: return b'\r\n' . join ( headers )