Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Use cache-buster for all mid-write GET requests

  • Loading branch information...
commit acbec48372bc1816c67c9e7cbf814cf50437ff93 1 parent 0e82e17
@isaacs isaacs authored
View
3  lib/adduser.js
@@ -81,7 +81,8 @@ function adduser (username, password, email, cb) {
this.log.verbose("adduser", "update existing user")
return this.request('GET'
- , '/-/user/org.couchdb.user:'+encodeURIComponent(username)
+ , '/-/user/org.couchdb.user:'+encodeURIComponent(username) +
+ '?write=true'
, function (er, data, json, response) {
if (er || data.error) {
return cb(er, data, json, response)
View
2  lib/deprecate.js
@@ -14,7 +14,7 @@ function deprecate (name, ver, message, cb) {
var users = {}
- this.get(name, function (er, data) {
+ this.get(name + '?write=true', function (er, data) {
if (er) return cb(er)
// filter all the versions that match
Object.keys(data.versions).filter(function (v) {
View
2  lib/publish.js
@@ -95,7 +95,7 @@ function putFirst (data, tardata, stat, username, email, cb) {
return cb(er, parsed, json, res)
// let's see what versions are already published.
- var getUrl = data.name + "?publishing=true"
+ var getUrl = data.name + "?write=true"
this.request("GET", getUrl, function (er, current) {
if (er)
return cb(er)
View
2  lib/star.js
@@ -7,7 +7,7 @@ function star (package, starred, cb) {
var users = {}
- this.request("GET", package, function (er, fullData) {
+ this.request("GET", package + '?write=true', function (er, fullData) {
if (er) return cb(er)
fullData = { _id: fullData._id
View
3  lib/unpublish.js
@@ -14,7 +14,8 @@ var semver = require("semver")
function unpublish (name, ver, cb) {
if (typeof cb !== "function") cb = ver, ver = null
- this.get(name, null, -1, true, function (er, data) {
+ var u = name + '?write=true'
+ this.get(u, null, -1, true, function (er, data) {
if (er) {
this.log.info("unpublish", name+" not published")
return cb()
View
2  test/adduser-update.js
@@ -32,7 +32,7 @@ tap.test("update a user acct", function (t) {
res.json({error: "conflict"})
})
- server.expect("GET", "/-/user/org.couchdb.user:username", function (req, res) {
+ server.expect("GET", "/-/user/org.couchdb.user:username?write=true", function (req, res) {
t.equal(req.method, "GET")
res.json(userdata)
})
View
2  test/publish-again.js
@@ -36,7 +36,7 @@ tap.test("publish again", function (t) {
})
})
- server.expect("/npm-registry-client?publishing=true", function (req, res) {
+ server.expect("/npm-registry-client?write=true", function (req, res) {
t.equal(req.method, "GET")
t.ok(lastTime)
for (var i in lastTime.versions) {
Please sign in to comment.
Something went wrong with that request. Please try again.