Permalink
Browse files

fail on legacy package names more usefully

  • Loading branch information...
1 parent b78aa86 commit bf37e8154584874c40fb32fc71f4c18e8d45c014 @othiym23 othiym23 committed May 24, 2014
Showing with 4 additions and 1 deletion.
  1. +4 −1 lib/get.js
View
@@ -22,12 +22,15 @@ function get (uri, options, cb) {
assert(cb, "must have callback")
if (!options) options = {}
+ var parsed = url.parse(uri)
+ assert(parsed.protocol, "must have a URL that starts with npm:, http:, or https:")
+
var cache = this.cacheFile(uri) + "/.cache.json"
// /-/all is special.
// It uses timestamp-based caching and partial updates,
// because it is a monster.
- if (url.parse(uri).pathname === "/-/all") {
+ if (parsed.pathname === "/-/all") {
return requestAll.call(this, uri, cache, cb)
}

0 comments on commit bf37e81

Please sign in to comment.