Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What is the purpose of this pull request?
What changes did you make? (provide an overview)
Added option to pass
insecureHTTPParser
parameter to the http(s).request here https://nodejs.org/docs/latest-v12.x/api/http.html#http_http_request_options_callback.It looks like there was recently a similar discussion around this for TLS Options, which can be configured on the agent (undocumented). The impetus for this PR is the ability to pass the
insecureHTTPParser
option, which as far as I can tell can't be set on the agent.Which issue (if any) does this pull request address?
#724
Is there anything you'd like reviewers to know?
See the previous discussion over here: #855
Here's some background reading: nodejs/node#27711
Sounds like it's a fairly common issue with the Incapsula CDN.
Why not just use the Agent?
Running this on node 12.x LTS will get you this:
We need the
insecureHTTPParser
option on the request to override this on a per-call basis. https://nodejs.org/api/http.html#http_http_request_options_callback