GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — lib: use validateString · nodejs/node@4ee4679

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • lib
    • _http_client.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎lib/_http_client.js‎

Copy file name to clipboardExpand all lines: lib/_http_client.js
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ const {
8080
const {
8181
validateInteger,
8282
validateBoolean,
83+
validateString,
8384
} = require('internal/validators');
8485
const { getTimerDuration } = require('internal/timers');
8586
const {
@@ -270,12 +271,11 @@ function ClientRequest(input, options, cb) {
270271
delete optsWithoutSignal.signal;
271272
}
272273
let method = options.method;
273-
const methodIsString = (typeof method === 'string');
274-
if (method !== null && method !== undefined && !methodIsString) {
275-
throw new ERR_INVALID_ARG_TYPE('options.method', 'string', method);
274+
if (method != null) {
275+
validateString(method, 'options.method');
276276
}
277277

278-
if (methodIsString && method) {
278+
if (method) {
279279
if (!checkIsHttpToken(method)) {
280280
throw new ERR_INVALID_HTTP_TOKEN('Method', method);
281281
}

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.