Fix Rackspace getFiles Parameters #120

wants to merge 2 commits into


None yet
4 participants

rottmann commented May 3, 2013

Rackspace returns different details with underscore, not with minus
content_type content-type

Example at issue nodejitsu#105

I dont now if this was a change in rackspace api (use it since a short time), so i leave content-type and the other changed fields as fallback in code.


indexzero commented May 6, 2013

@kenperkins is this a v1 vs v2 change?

rottmann commented May 6, 2013

I use rackspace since v2, i dont know how it look in v1. Thats why i leave the fallback parameters with - if there is not underscore value.

scien commented May 24, 2013

The v1 docs claim Content-Type ( but I'm reading from a v1 container and also had content_type returned.

I think this is safe to merge as is.


kenperkins commented May 28, 2013

@rottmann I'm struggling to find a repo for this test.

Every time I request the properties for a file, I get headers with:

content-type: 'as/appropriate'

Can you help me understand your problem or help with a repro case?

scien commented May 29, 2013

I don't get "content-type" connecting to any CloudFiles container

cfg = require './config'
pkgcloud = require 'pkgcloud'

client = {
  provider: 'rackspace'
  username: cfg.rackspace.username
  apiKey: cfg.rackspace.key
client.getContainer 'media', (err, container) ->
  throw err if err
  client.getFiles container, (err, files) ->
    console.log files

connecting to first-gen cloudfiles container

{ hash: 'c7caa4ac037d4a7168503f6b2a5bdfc6',
  last_modified: '2013-01-13T16:59:47.581130',
  bytes: 51326,
  name: '2011/01/image.jpg',
  content_type: 'image/jpeg',
   { ...} 

connecting to open-cloud cloudfiles container

  { _events: {},
    newListener: false,
    _conf: { delimiter: '::', wildcard: true },
    delimiter: '::',
    wildcard: true,
    listenerTree: {},
    client:  { … },
    metadata: {},
    container: { … },
    name: '2013/05/image.jpg',
    etag: null,
    contentType: 'image/jpeg',
    lastModified: Fri May 10 2013 17:20:28 GMT-0400 (EDT),
    bytes: 371658,
    size: 371658 

OMG Rackspace change the name style again :( now they use CamelCase.
Now contentType, lastModified is returned.
I update my fork, i hope the rewrite of modul in main repo will finish soon.

@kenperkins kenperkins added a commit to rackspace/pkgcloud that referenced this pull request May 30, 2013

@kenperkins kenperkins [rackspace] Fixing getFiles metadata not matching File expectations
Fixes #105, #120

kenperkins closed this May 30, 2013


kenperkins commented May 30, 2013

I've address this as I was already in the code; I see what you're saying btw, the API returns different values for getFile and getFiles, not pkgcloud proper.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment