Skip to content

Set custom default value for content-header-bytes-length#114

Merged
benoit74 merged 1 commit intomainfrom
content_header_length
Feb 11, 2025
Merged

Set custom default value for content-header-bytes-length#114
benoit74 merged 1 commit intomainfrom
content_header_length

Conversation

@benoit74
Copy link
Collaborator

We have regular occurrences of zimit failures due to the charset encoding being too far at the beginning of the HTML document. By default, we expect it to be in the first 1024 bytes. This is a sensible default because recommendations are that this should be at the beginning of the HTML head. Not all sites follow this convention, and many are far from that.

I propose to override default content-header-bytes-length only on zimit-frontend to accommodate more sites for non-knowledgeable persons.

We do not want to expose this setting on zimit.kiwix.org because it is too complex.

We should not change warc2zim default (1024) which is still the best comprise value, when you have someone knowledgeable using the tool, because it avoid spending too much resources on this.

WDYT?

override default content-header-bytes-length to accomodate more sites
we do not want to expose this setting which is too complex + we do not want
to change warc2zim default which is still the best comprise value, when you
have someone knowledgeable using the tool
@benoit74 benoit74 self-assigned this Feb 11, 2025
@benoit74 benoit74 marked this pull request as ready for review February 11, 2025 12:29
@benoit74 benoit74 requested a review from rgaudin February 11, 2025 12:29
@codecov
Copy link

codecov bot commented Feb 11, 2025

Codecov Report

Attention: Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Project coverage is 45.99%. Comparing base (4a201ec) to head (d015a24).
Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
api/src/zimitfrontend/routes/requests.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #114      +/-   ##
==========================================
- Coverage   46.11%   45.99%   -0.12%     
==========================================
  Files          10       10              
  Lines         386      387       +1     
  Branches       44       44              
==========================================
  Hits          178      178              
- Misses        206      207       +1     
  Partials        2        2              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@benoit74 benoit74 merged commit 409a4d8 into main Feb 11, 2025
5 of 7 checks passed
@benoit74 benoit74 deleted the content_header_length branch February 11, 2025 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants