http: verify method is a string
Checklist
-
tests and/or benchmarks are included -
commit message follows commit guidelines
Affected core subsystem(s)
http
Description of change
Added strict check for http request method
to be a string
. If method
is not a string (or undefined
or null
) a TypeError
exceptions is thrown.
The method
value is still defaulted to GET
in the following cases:
-
method
isundefined
-
method
isnull
This fixes thehttp-client
to crash ifoptions.method
inhttp.request
was set to a number not equal to 0.