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

Added optional support for CORS requests for assets on rackspace #149

Open
wants to merge 16 commits into
base: master
Choose a base branch
from

Conversation

fountainheadpro
Copy link

Rackspace does not support CORS policy management from web console and requeres API calls to set CORS headers. This patch adds the CORS headers to the file upload operation, so the assets are becoming available for CORS requests.

@trobrock
Copy link

👍 Is this project still active @rumblelabs ?

@davidjrice
Copy link
Contributor

Yes, it is. However we do not have automated integration tests for rackspace yet. Mainly as it's not a service I use...

I'm 👍 on this too, need to get the time to bring in some tests and merge this in

On Sunday, 24 March 2013 at 02:17, Trae Robrock wrote:

Is this project still active @rumblelabs (https://github.com/rumblelabs) ?


Reply to this email directly or view it on GitHub (#149 (comment)).

@trobrock
Copy link

Ok great. I can help out here if needed. Also if it helps I'm using this
branch in production currently
On Mar 24, 2013 8:20 AM, "David Rice" notifications@github.com wrote:

Yes, it is. However we do not have automated integration tests for
rackspace yet. Mainly as it's not a service I use...

I'm 👍 on this too, need to get the time to bring in some tests and
merge this in

On Sunday, 24 March 2013 at 02:17, Trae Robrock wrote:

Is this project still active @rumblelabs (https://github.com/rumblelabs)
?


Reply to this email directly or view it on GitHub (
#149 (comment)).


Reply to this email directly or view it on GitHubhttps://github.com//pull/149#issuecomment-15360597
.

@davidjrice
Copy link
Contributor

Hey, can you please rebase this, hopefully the build will pass and we can look at getting it merged in, cheers.

@fountainheadpro
Copy link
Author

Could you clarify on :custom_headers config parameter. Does is replace the CORS fix?

…ure if one of the files failed to upload. always_upload_all - will always upload all files.
@davidjrice
Copy link
Contributor

Not my intention to replace the CORS addition, it is something that needs thought about and merged between the two streams of development. Perhaps an internal dsl for supplying rules of what to do with different types of assets

On Tuesday, 30 April 2013 at 01:33, fountainheadpro wrote:

Could you clarify on :custom_headers config parameter. Does is replace the CORS fix?


Reply to this email directly or view it on GitHub (#149 (comment)).

@fountainheadpro
Copy link
Author

Got it. One more question, why not always use MIME::Types? Rack::Mime gives me problems specifically with .ttf for fonts.

upload_file f
rescue Exception => ex
log "error - #{$!} - file: #{f}"
railse ex unless config.warn_on_failure

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be raise

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch, fixed.

@josephlord
Copy link
Contributor

I'm using this successfully too (thanks fountainheadpro). Just wanted to let you know of the interest for this (or another mechanism of setting the CORS options on Rackspace) to be integrated.

@fountainheadpro
Copy link
Author

Would be great to see it integrated, so I can stop using my fork for the
gem.
Thanks!

On Mon, Oct 21, 2013 at 3:41 AM, Joseph Lord notifications@github.comwrote:

I'm using this successfully too (thanks fountainheadpro). Just wanted to
let you know of the interest for this (or another mechanism of setting the
CORS options on Rackspace) to be integrated.


Reply to this email directly or view it on GitHubhttps://github.com//pull/149#issuecomment-26707160
.

@kikuchiyo
Copy link

@fountainheadpro I was able to stop the above #234 issue via including gem 'unf' in my Gemfile that uses your forked repo. I would also like to get this integrated and think making it a dependency of the gem would resolve the issue.

@forus-coop
Copy link

@rumblelabs any chance of getting this one integrated?

@josephlord
Copy link
Contributor

@davidjrice Is this going to be merged at some point? I've had it running fine on Heroku for about 9 months now.

@josephlord
Copy link
Contributor

@tosbourn Any chance you can get to this PR. I and several others are using it already.

@citrus
Copy link

citrus commented Oct 24, 2014

👍

@nathancolgate
Copy link

FWIW I was able to get the same kind of header access simply using:

config.custom_headers = {
  "\.(ttf|otf|eot|woff|svg)$" => {
    access_control_allow_origin: '*'
  }
}

in my asset_sync.rb file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants