Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rackspace uploads ignore default metadata headers specified in user.config #8518

Closed
cyberduck opened this issue Jan 22, 2015 · 9 comments
Closed
Assignees
Labels
Milestone

Comments

@cyberduck
Copy link
Collaborator

28195e3 created the issue

I'm uploading files to a Rackspace Cloud Files container, and need to add the Access-Control-Allow-Origin: * header to all files. From the docs --

https://trac.cyberduck.io/wiki/help/en/howto/cloudfiles#Defaultmetadata

https://trac.cyberduck.io/wiki/help/en/howto/preferences#Hiddenconfigurationoptions

I understand that I can set the default metadata headers for uploads in user.config.

\
I added the following to <settings> in C:\Users<name>\AppData\Roaming\Cyberduck\Cyberduck.exe_Url_<...>\4.6.1.16121\user.config:

<setting name="cf.metadata.default" value="Access-Control-Allow-Origin=*" />

But when I upload the files to Rackspace, Cyberduck uploads them without this header.

Fiddler shows that Cyberduck PUTs the file without the custom header, and doesn't additionally POST the header:

PUT https://storage101.ord1.clouddrive.com/v1/MossoCloudFS_.../container-name/myfile.htm HTTP/1.1
Content-Type: text/html
X-Auth-Token: ...
Content-Length: 10864
Host: storage101.ord1.clouddrive.com
Connection: Keep-Alive
User-Agent: Cyberduck/4.6.3 (16490) (Windows 7/6.1) (x86)
Accept-Encoding: gzip,deflate

<!DOCTYPE html>
...

\
If I PUT the file using cURL, the header gets added correctly:

> curl -i -X PUT -T myfile.htm -H "X-Auth-Token: ..." -H "Access-Control-Allow-Origin: *" https://storage101.ord1.clouddrive.com/v1/MossoCloudFS_.../container-name/myfile.htm
HTTP/1.1 201 Created

> curl -i -X HEAD -H "X-Auth-Token: ..." https://storage101.ord1.clouddrive.com/v1/MossoCloudFS_.../container-name/myfile.htm
HTTP/1.1 200 OK
...
Access-Control-Allow-Origin: *
Content-Type: text/html
...
@cyberduck
Copy link
Collaborator Author

@dkocher commented

This is a documentation error. The correct property name is openstack.metadata.default.

@cyberduck
Copy link
Collaborator Author

@cyberduck
Copy link
Collaborator Author

28195e3 commented

openstack.metadata.default doesn't work for me. The header isn't PUT/POSTed during upload.

@cyberduck
Copy link
Collaborator Author

@dkocher commented

Added test in 57571f2.

@cyberduck
Copy link
Collaborator Author

@dkocher commented

Replying to [comment:3 Olga]:

openstack.metadata.default doesn't work for me. The header isn't PUT/POSTed during upload.
Have you restarted Cyberduck after making the changes?

@cyberduck
Copy link
Collaborator Author

28195e3 commented

I close Cyberduck before editing the config file.

I tried (in turns) the CORS header:

...
<setting name="CdSettings" serializeAs="Xml">
  <value>
    <settings>
      ...
      <setting name="openstack.metadata.default" value="Access-Control-Allow-Origin=*" />
    </settings>
  </value>
</setting>
...

and the example from the documentation:

<setting name="openstack.metadata.default" value="Creator=Cyberduck" />

Also updated to 4.6.4. But the PUT request is the same - without this header.

Any ideas?

@cyberduck
Copy link
Collaborator Author

@ylangisc commented

I'm unable to reproduce the issue. Works for me. Are you sure that you have edited the correct user.config?

C:\Users\<name>\AppData\Roaming\Cyberduck\Cyberduck.exe_Url_<...>\4.6.1.16121\user.config

The issue is reported against 4.6.3 but apparently you changed the 4.6.1 settings. Can you please update to 4.6.4 and edit the appropriate user.config.

@cyberduck
Copy link
Collaborator Author

28195e3 commented

OK, there seems to be another doc error here:
https://trac.cyberduck.io/wiki/help/en/faq#Windows2

It says on Windows 7 the user.config lives in %APPDATA%\Cyberduck\…, but it's actually in %APPDATA%\iterate_GmbH\…, separately from all other app support files:

Roaming\
  Cyberduck\
    Bookmarks\
    ...
    Transfers\
    cyberduck.log
  iterate_GmbH\
    Cyberduck.exe_Url_*\
      4.6.3.16490\
        user.config
      4.6.4.16610\
        user.config

The path must have been changed in 4.6.2 or 4.6.3.

So I was editing a wrong file left over from 4.6.1. After I changed the correct file the currently installed version 4.6.4, it worked.

Thanks!

@cyberduck
Copy link
Collaborator Author

@dkocher commented

Replying to [comment:9 Olga]:

OK, there seems to be another doc error here:
https://trac.cyberduck.io/wiki/help/en/faq#Windows2

Fixed in (https://trac.cyberduck.io/wiki/help/en/faq?version=110).

@iterate-ch iterate-ch locked as resolved and limited conversation to collaborators Nov 26, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants