diff --git a/recorder/test/test_recorder.py b/recorder/test/test_recorder.py index 857efb79..97a47f46 100644 --- a/recorder/test/test_recorder.py +++ b/recorder/test/test_recorder.py @@ -418,6 +418,7 @@ class TestRecorder(LiveServerTests, FakeRedisTests, TempDirTests, BaseTestClass) parsed_record = ArcWarcRecordLoader().parse_record_stream(buff) assert parsed_record.rec_headers.get_header('WARC-Type') == 'warcinfo' + assert parsed_record.rec_headers.get_header('Content-Type') == 'application/warc-fields' assert parsed_record.rec_headers.get_header('WARC-Filename') == 'testfile.warc.gz' buff = parsed_record.stream.read().decode('utf-8') diff --git a/recorder/warcwriter.py b/recorder/warcwriter.py index f74ddba7..7b82d6a0 100644 --- a/recorder/warcwriter.py +++ b/recorder/warcwriter.py @@ -120,7 +120,6 @@ class BaseWARCWriter(object): if filename: headers['WARC-Filename'] = filename headers['WARC-Date'] = datetime_to_iso_date(datetime.datetime.utcnow()) - headers['Content-Type'] = 'application/warc-fields' warcinfo = BytesIO() for n, v in six.iteritems(kwargs): @@ -174,7 +173,7 @@ class BaseWARCWriter(object): if not content_type: content_type = self.WARC_RECORDS[record.rec_headers['WARC-Type']] - self._header(out, 'Content-Type', record.content_type) + self._header(out, 'Content-Type', content_type) if record.rec_headers['WARC-Type'] == 'revisit': http_headers_only = True