Override SubstituteMaxLineLength in PyPI proxies

We've been getting the following error for some pages we're proxying
today:

    AH01328: Line too long, URI /pypi/simple/grpcio/,

While we suspect PyPI or its Fastly CDN may have served some unusual
contents for the affected package indices, the content gets cached
and then mod_substitute trips over the result because it (as of
2.3.15) enforces a maximum line length of one megabyte:

    https://bz.apache.org/bugzilla/show_bug.cgi?id=56176

Override that default to "5m" per the example in Apache's
documentation:

    https://httpd.apache.org/docs/2.4/mod/mod_substitute.html

Change-Id: I5351f0465287f695fb2f1957062182fd3bf6c226
This commit is contained in:
Jeremy Stanley 2022-07-21 17:12:06 +00:00
parent af6171c95e
commit 6de6c5f181

View File

@ -100,6 +100,7 @@ ErrorLogFormat "[%{cu}t] [%-m:%l] [pid %P:tid %T] %7F: %E: [client\ %a] %M% , \
# Rewrite the locations of the actual files
<Location /pypi>
SetOutputFilter INFLATE;SUBSTITUTE;DEFLATE
SubstituteMaxLineLength 5m
Substitute "s|https://files.pythonhosted.org/|/pypifiles/|ni"
</Location>
@ -251,6 +252,7 @@ ErrorLogFormat "[%{cu}t] [%-m:%l] [pid %P:tid %T] %7F: %E: [client\ %a] %M% , \
# Rewrite the locations of the actual files
<Location /pypi>
SetOutputFilter INFLATE;SUBSTITUTE;DEFLATE
SubstituteMaxLineLength 5m
Substitute "s|https://files.pythonhosted.org/|/pypifiles/|ni"
</Location>