Closed garthk closed 9 years ago
Trace as requested:
TypeError: Cannot read property 'length' of null
at S.endsWith (/tmp/node_modules/bhttp/node_modules/string/lib/string.js:167:24)
at S.chompRight (/tmp/node_modules/bhttp/node_modules/string/lib/string.js:104:16)
at /tmp/node_modules/bhttp/lib/bhttp.js:183:47
at tryCatcher (/tmp/node_modules/bluebird/js/main/util.js:24:31)
at Function.Promise.attempt.Promise.try (/tmp/node_modules/bluebird/js/main/method.js:31:24)
at prepareUrl (/tmp/node_modules/bhttp/lib/bhttp.js:172:24)
at /tmp/node_modules/bhttp/lib/bhttp.js:364:16
at tryCatcher (/tmp/node_modules/bluebird/js/main/util.js:24:31)
at Promise._settlePromiseFromHandler (/tmp/node_modules/bluebird/js/main/promise.js:452:31)
at Promise._settlePromiseAt (/tmp/node_modules/bluebird/js/main/promise.js:530:18)
at Promise._settlePromises (/tmp/node_modules/bluebird/js/main/promise.js:646:14)
at Async._drainQueue (/tmp/node_modules/bluebird/js/main/async.js:132:16)
at Async._drainQueues (/tmp/node_modules/bluebird/js/main/async.js:142:10)
at Immediate.Async.drainQueues [as _onImmediate] (/tmp/node_modules/bluebird/js/main/async.js:16:14)
at processImmediate [as _immediateCallback] (timers.js:358:17)
Fixed in v1.1.3 (9ebbc7d98ca1adc1aa5b02fa117a89e2fd262aae).
Faced with a relative URI,
bhttp
1.1.2 crashes with aTypeError
inendsWith
becauseprepareUrl
doesn't expecturlOptions.protocol
to benull
.Clients not supporting relative
Location
URI references were defensible while RFC2116 was current:… but this was a violation of Postel's Law, as browsers and search engines widely supported relative references and many servers relied upon them. (Those servers were also violating Postel's Law, just in the opposite direction.)
RFC2116 was obsoleted by RFC7231 in June 2014, baking relative URI support into the HTTP/1.1 standard: