Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

make inline attachments possible

  • Loading branch information...
commit c2279447cf1e1b1a55b51f768d2bb66bb3514381 1 parent 4400be5
Dominic Tarr dominictarr authored isaacs committed
Showing with 14 additions and 0 deletions.
  1. +14 0 registry/updates.js
14 registry/updates.js
View
@@ -110,6 +110,19 @@ updates.package = function (doc, req) {
if (!doc.users) doc.users = {}
doc.users[req.userCtx.name] = newdoc.users[req.userCtx.name]
}
+
+ if(newdoc._attachments) {
+ var inline = false
+ for(var k in newdoc._attachments) {
+ if(newdoc._attachments[k].data) {
+ doc._attachments[k] = newdoc._attachments[k]
+ inline = true
+ }
+ }
+ if(inline)
+ return ok(doc, "updated package metadata & attachments")
+ }
+
return ok(doc, "updated package metadata")
} else {
// Create new package doc
@@ -127,6 +140,7 @@ updates.package = function (doc, req) {
}
if (!doc['dist-tags']) doc['dist-tags'] = {}
if (latest) doc["dist-tags"].latest = latest
+
return ok(doc, "created new entry")
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.