Skip to content

Commit

Permalink
Merge pull request #315 from openzim/non_html_document
Browse files Browse the repository at this point in the history
Use mimetype to selectively rewrite only html documents
  • Loading branch information
benoit74 authored Jun 14, 2024
2 parents f85c8d8 + 5cb3a75 commit ed63f4d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/warc2zim/content_rewriting/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ def get_rewrite_mode(self, record, mimetype):
def get_resourcetype_rewrite_mode(self, record, resourcetype, mimetype):
"""Get current record rewrite mode based on WARC-Resource-Type and mimetype"""

if resourcetype == "document":
if resourcetype == "document" and mimetype == "text/html":
# TODO : Handle header "Accept" == "application/json"
if getattr(record, "method", "GET") == "GET":
return "html"
Expand Down

0 comments on commit ed63f4d

Please sign in to comment.