You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The node HTTP integration occasionally misses the protocol from URL when it does argument normalisation. This is issue is caused by assuming that the arguments passed to http.request or https.request will always contain a protocol. However when making direct calls to https.request and http.request the protocol argument is optional, with the protocol default being set by the class being called.
A number of libraries seem to make use of this feature including Microsoft's Application Insights and the deprecated request library. The end result is requests originating from libraries like this end up with their protocols striped and invalid URL's being created (according to the WHATWG URL API).
The fix would be make the wrapper functions support the default values for the protocol argument, and better match the underlying Node API. I think a possible approach to extract the default protocol is to look a the modules globalAgent or the agent passed in the arguments done before extractUrl is called, something like:
Package + Version
@sentry/node
Version:
Description
The node HTTP integration occasionally misses the protocol from URL when it does argument normalisation. This is issue is caused by assuming that the arguments passed to
http.request
orhttps.request
will always contain a protocol. However when making direct calls tohttps.request
andhttp.request
the protocol argument is optional, with the protocol default being set by the class being called.A number of libraries seem to make use of this feature including Microsoft's Application Insights and the deprecated request library. The end result is requests originating from libraries like this end up with their protocols striped and invalid URL's being created (according to the WHATWG URL API).
The fix would be make the wrapper functions support the default values for the protocol argument, and better match the underlying Node API. I think a possible approach to extract the default protocol is to look a the modules
globalAgent
or theagent
passed in the arguments done beforeextractUrl
is called, something like:The text was updated successfully, but these errors were encountered: