Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Confusing boolean is confusing

  • Loading branch information...
commit f305fb8a3e8b56e5ecbe04190ee6733397a47d46 1 parent 3f9b6b0
@isaacs isaacs authored
Showing with 6 additions and 5 deletions.
  1. +6 −5 lib/request.js
View
11 lib/request.js
@@ -29,11 +29,12 @@ function regRequest (method, where, what, etag, nofollow, cb_) {
var registry = this.registry
var adduserChange = /^\/?-\/user\/org\.couchdb\.user:([^\/]+)\/-rev/
- , adduserNew = /^\/?-\/user\/org\.couchdb\.user:([^\/]+)/
- , authRequired = (what || this.alwaysAuth)
- && !where.match(adduserNew)
- || where.match(adduserChange)
- || method === "DELETE"
+ , adduserNew = /^\/?-\/user\/org\.couchdb\.user:([^\/]+)/
+ , nu = where.match(adduserNew)
+ , uc = where.match(adduserChange)
+ , isUpload = what || this.alwaysAuth
+ , isDel = method === "DELETE"
+ , authRequired = isUpload && !nu || uc || isDel
// resolve to a full url on the registry
if (!where.match(/^https?:\/\//)) {
Please sign in to comment.
Something went wrong with that request. Please try again.