[ 
https://issues.apache.org/jira/browse/JCLOUDS-578?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14013225#comment-14013225
 ] 

Andrew Gaul commented on JCLOUDS-578:
-------------------------------------

[~jdaggett] This issue tracks the older swift provider.  What is the status of 
this support in the newer openstack-swift provider?

> Custom HTTP Headers in Rackspace SwiftObjects are ignored 
> ----------------------------------------------------------
>
>                 Key: JCLOUDS-578
>                 URL: https://issues.apache.org/jira/browse/JCLOUDS-578
>             Project: jclouds
>          Issue Type: Bug
>          Components: jclouds-blobstore
>    Affects Versions: 1.7.1
>            Reporter: Daren Klamer
>            Priority: Minor
>              Labels: rackspace
>
> Rackspace allows users to set custom HTTP Headers on their files that are 
> being served. This is especially useful for web fonts, as some browsers 
> refuse to use the fonts unless the following header is set (more info 
> [here|http://davidwalsh.name/cdn-fonts]):
> {{Access-Control-Allow-Origin: *}}
> Upon getting a SwiftObject from my Rackspace CloudFilesClient object and 
> calling {{getAllHeaders().put( "Access-Control-Allow-Origin", "*" )}} I could 
> see that the header was being lost and not sent with the underlying HTTP 
> request.
> As a workaround here I patched 
> [{{org.jclouds.openstack.swift.binders.BindSwiftObjectMetadataToRequest}}|https://github.com/jclouds/jclouds/blob/master/apis/swift/src/main/java/org/jclouds/openstack/swift/binders/BindSwiftObjectMetadataToRequest.java].
>  Instead of simply binding the blob to the request and returning it (lines 86 
> + 87), I changed it to bind the blob, then added all headers from the blob to 
> the request.
> {{Blob blob = object2Blob.apply( object );}}
> {{request = mdBinder.bindToRequest( request, blob );}}
> {{return ( R ) request.toBuilder().replaceHeaders( blob.getAllHeaders() 
> ).build();}}



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to