Skip to content

Commit

Permalink
Fix temp uri with snet. Closes #1.
Browse files Browse the repository at this point in the history
  • Loading branch information
rossj committed Jul 25, 2012
1 parent 33cb27b commit 95b5c33
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions lib/rackit.js
Expand Up @@ -643,15 +643,13 @@ Rackit.prototype._getCDNURI = function(sCloudPath) {
Rackit.prototype._getTempURI = function(sCloudPath, ttl) {
var o1 = this;

// o1.config.storage = 'https://storage101.dfw1.clouddrive.com/v1/MossoCloudFS_d58d266b-3601-4d95-8e96-2063c9caef48';
// sCloudPath = 'test/test.txt';
// o1.options.tempURLKey = '7acc0fe42358c0232053b3fc7254609c';

// If ttl is given, generate at emp URI
var method = 'GET';
var expires = Math.floor(Date.now() / 1000) + ttl;

var storageParts = url.parse(o1.config.storage);
// Remove snet- from the url (if its there), since this will generally be a public url
var storage = o1.config.storage.replace('https://snet-', 'https://');
var storageParts = url.parse(storage);
var path = storageParts.pathname + '/' + sCloudPath;

var body = method + '\n' + expires + '\n' + path;
Expand Down

0 comments on commit 95b5c33

Please sign in to comment.