Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
crwbasnayake authored Jul 14, 2020
1 parent ff182d5 commit a4a7ba1
Showing 1 changed file with 1 addition and 28 deletions.
29 changes: 1 addition & 28 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,4 @@
# RackspaceCloudFileMetadataUpdater

If content in your Cloud Files account isn’t loading on your website, it might be due to Cross-Origin Resource Sharing (CORS), a security feature designed to prevent malicious content from loading in a web page by default. If your files load Asynchronous JavaScript and XML (AJAX) or embed fonts, CORS might prevent them from loading.

You can correct this issue by using this NodeJS project to change the headers in your Cloud Files using nodejs api. I created this project to update my cloud files cors policy.

https://developer.rackspace.com/docs/cloud-files/quickstart/?lang=node.js#change-object-metadata

Important:
I had to modify pkgcloud node module to remove "x-object-meta-" prefix when setting the headers. So I have uploaded customized node_module in side the project. So you can use it.

_createHeaders: function (metadata) {
var headers = {};# Rackspace Cloud File Metadata Bulk Updater
# Rackspace Cloud File Metadata Bulk Updater

If content in your Cloud Files account isn’t loading on your website, it might be due to Cross-Origin Resource Sharing (CORS), a security feature designed to prevent malicious content from loading in a web page by default. If your files load Asynchronous JavaScript and XML (AJAX) or embed fonts, CORS might prevent them from loading.

Expand Down Expand Up @@ -38,18 +26,3 @@ const OBJECT_META_PREFIX = '';
Created by:
Charitha Basnayake
[email protected]
Object.keys(metadata).forEach(function (key) {
//I removed this "x-object-meta-" prefix to fix cors origin key issue
var header = "x-object-meta-" + key;
headers[header] = metadata[key];
});

return headers;
}

# CORS
Cross-Origin Resource Sharing (CORS) is a mechanism that allows code running in a browser to make requests to a domain other than the one from which it originated by using HTTP headers, such as those assigned by Cloud Files API requests.

Cloud Files supports CORS requests to containers and objects.

For more information about CORS and the access control headers, see www.w3.org/TR/access-control/.

0 comments on commit a4a7ba1

Please sign in to comment.