This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Put in config/initializers/html_sanitizer.rb | |
# | |
# See https://github.com/rails/rails-html-sanitizer/blob/master/lib/rails/html/scrubbers.rb | |
# for more help on how the PermitScrubber works and the functions you can override. | |
class CustomScrubber < Rails::Html::PermitScrubber | |
def initialize | |
super | |
puts("CustomScrubber says hi!") | |
self.tags = %w( script iframe figure figcaption action-text-attachment ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Sets CORS headers for request from example1.com and example2.com pages | |
# for both SSL and non-SSL | |
SetEnvIf Origin "^https?://[^/]*(example1|example2)\.com$" ORIGIN=$0 | |
Header set Access-Control-Allow-Origin %{ORIGIN}e env=ORIGIN | |
Header set Access-Control-Allow-Credentials "true" env=ORIGIN | |
# Always set Vary: Origin when it's possible you may send CORS headers | |
Header merge Vary Origin |