http: more strict statusCode validation
Checklist
-
make -j8 test
(UNIX), orvcbuild test nosign
(Windows) passes -
tests and/or benchmarks are included -
commit message follows commit guidelines
Affected core subsystem(s)
HTTP
Description of change
This removes the http statusCode coercion, and instead performs more strict validation on the original value, either using it unchanged or throwing.
Of note, some values that were previously accepted no longer are:
- Any otherwise-valid string:
'200'
previously was accepted, it throws a TypeError with this change - Numbers with decimals:
200.6
was previously accepted (and silently coerced to200
), it throws a RangeError with this change.
All non-number values will now get a TypeError instead of a RangeError.
Fixes #9027 (closed)