1
0
mirror of https://github.com/webrecorder/pywb.git synced 2025-03-15 00:03:28 +01:00

Extract WARC field "WARC-Identified-Payload-Type" (#251)

and add it as field "mime-detected" to index entry
This commit is contained in:
Sebastian Nagel 2017-10-13 17:13:55 +02:00 committed by Ilya Kreymer
parent 54b265aaa8
commit 09295747b7

View File

@ -265,6 +265,9 @@ class DefaultRecordParser(object):
entry.extract_mime(record.http_headers.
get_header('Content-Type'),
def_mime)
# detected mime from WARC-Identified-Payload-Type
entry['mime-detected'] = record.rec_headers.get_header(
'WARC-Identified-Payload-Type')
# status -- only for response records (by convention):
if record.rec_type == 'response' and not self.options.get('minimal'):