Skip to content
Myr

Improve error with invalid arguments to req.get()

Before adoption: this commit came in with the history the project adopted, so no landing records it.

fixes #2993

authored by Douglas Christopher Wilson · committed by Douglas Christopher Wilson · parent 5d642af · Browse files · 3 files+34 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

3 files+34 added−1 removed

  • tests:+25 added−1 removed
  • other:+9 added−0 removed

3 files+34 added−1 removed

modified:lib/request.js+8 added
55 unmodified lines
56 */5758req.get =59req.header = function header(name) {60 if (!name) {61 throw new TypeError('name argument is required to req.get');62 }6364 if (typeof name !== 'string') {65 throw new TypeError('name must be a string to req.get');66 }6768 var lc = name.toLowerCase();6970 switch (lc) {71 case 'referer':
431 unmodified lines
modified:test/req.get.js+25 added-1 removed
modified:History.md+1 added
2 unmodified lines
34 * Add `options` argument to `req.range`5 - Includes the `combine` option6 * Fix Windows absolute path check using forward slashes7 * Improve error with invalid arguments to `req.get()`8 * Improve performance for `res.json`/`res.jsonp` in most cases9 * deps: accepts@~1.3.310 - Fix including type extensions in parameters in `Accept` parsing11 - Fix parsing `Accept` parameters with quoted equals
3098 unmodified lines