I am just trying to prepend and append a certain string to Apache responses matching certain filetypes. I thought mod_substitute
would do the job, but it errors out all the time with: AH01328: Line too long
.
This is what my directive looks like:
<Location "/src">
AddType application/javascript .txt .tpl
AddOutputFilter SUBSTITUTE tpl txt
SubstituteMaxLineLength 10m
Substitute "s/([sS]*)/export default `$1`/i"
</Location>
As you can see I also tried to up the limit on SubstituteMaxLineLength
, but that seems to have no effects.
Any idea what I am doing wrong, or is there another option to solve this seemingly easy (well, apparently not so) task?
2
Answers
Got it resolved by using
mod_sed
, FYI:This helped me out, was getting random HTTP error messages regarding Network Timeout / Connection Closed before looking at error_log and seeing the error on mod_substitute.
I was able to add SubstituteMaxLineLength 10M (with the capital M) and it worked for me.
Thanks!