Add an option for maximum header size considered safe

This adds a default option for the maximum header size considered safe, rather than relying on a hard-coded value of 4000. While in the vast majority of use cases, 4000 is sufficient, there are some rare use cases where large header values may be useful or required.