Skip to content

Unable to check/get object manifest #561

@markchalloner

Description

@markchalloner

Hi,

There seems to be no easy way to check if an object is a manifest, i.e. get the value of the X-Object-Manifest header.

Manifests are used for large file uploads:
http://docs.rackspace.com/files/api/v1/cf-devguide/content/Large_Object_Creation-d1e2019.html
and "symlinks":
https://developer.rackspace.com/blog/simulate-symLinks-on-cloud-files/
They are defined by adding the X-Object-Manifest header, with a value of container/object/prefix
AbstractTransfer\createManifest()

DataObject\headerIsValidMetadata() uses the pattern ^X-Object-Meta- to filter the response headers, against which the X-Object-Manifest header fails.

Other headers e.g. Content-Type are set by DataObject\populateFromResponse()

Some ways I can see of allowing access to this information:

  • Allow access to all the response headers by saving $response->getHeaders() into a property.
  • Create is/get/setManifest methods and populate in DataObject\populateFromResponse()
  • Relax the metadata pattern filter to X-Object-

The current workaround is to retrieve the headers from the API, but as this requires another trip to the the Rackspace endpoint, is inefficient:

$response = $object->getClient()
    ->head($object->getUrl())
    ->send();
$headers = $response->getHeaders();
$manifest = (string) $headers['X-Object-Manifest'];
echo $manifest;

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions