Permalink
Browse files

Favicon!!

  • Loading branch information...
1 parent 286763c commit a883f1559356ef71d368f44960b1baf34700d246 @isaacs isaacs committed Nov 16, 2010
View
BIN html/favicon.ico
Binary file not shown.
View
BIN html/npm-16.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN html/npm-64-square.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
6 lib/utils/read-json.js
@@ -84,6 +84,12 @@ function processObject (opts, cb) { return function (er, json) {
if (cb) return cb(e)
throw e
}
+ if (json.name === "favicon.ico") {
+ var msg = "Sorry, favicon.ico is a picture, not a package."
+ , e = new Error(msg)
+ if (cb) return cb(e)
+ throw e
+ }
var tag = opts.tag
if (tag) json.version = tag//+"-"+json.version
View
3 lib/utils/registry/request.js
@@ -17,6 +17,9 @@ function request (method, where, what, etag, cb) {
log.verbose(where||"/", method)
if ( typeof etag === "function" && !cb ) cb = etag, etag = null
+ if (where.match(/^\/?favicon.ico/)) {
+ return cb(new Error("favicon.ico isn't a package, it's a picture."))
+ }
if ( typeof what === "function" && !cb ) cb = what, what = null
try { reg() }
catch (ex) { return cb(ex) }

0 comments on commit a883f15

Please sign in to comment.