Skip to content

Commit

Permalink
Authed api calls set nocache cookie for rest updates
Browse files Browse the repository at this point in the history
  • Loading branch information
davglass committed Nov 8, 2012
1 parent 7bbf2a6 commit 4411b26
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/api.js
Expand Up @@ -8,6 +8,12 @@ var util = require('./util'),
config = require('./config'),
log = require('./log'),
qs = require('querystring'),
jar = request.jar(),
cookie = request.cookie('yui_nocache'),
mod;

//add the cookie to the jar
jar.add(cookie);

mod = {
strictSSL: function() {
Expand Down Expand Up @@ -57,6 +63,7 @@ mod = {
}
log.debug('GET ' + this.host() + url);
request.get({
jar: jar,
url: this.host() + url,
strictSSL: this.strictSSL(),
headers: headers
Expand All @@ -82,6 +89,7 @@ mod = {
}
log.debug('POST ' + u);
request.post({
jar: jar,
url: u,
strictSSL: this.strictSSL(),
headers: headers,
Expand All @@ -99,6 +107,7 @@ mod = {

log.debug('PUT ' + u);
request.put({
jar: jar,
url: u,
strictSSL: this.strictSSL(),
headers: {
Expand Down Expand Up @@ -126,6 +135,7 @@ mod = {

log.debug('DELETE ' + u);
request.del({
jar: jar,
url: u,
strictSSL: this.strictSSL(),
headers: {
Expand Down

0 comments on commit 4411b26

Please sign in to comment.