1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
Commit graph

11 commits

Author SHA1 Message Date
Aaron Patterson
b001cbefa7
Don't evaluate ERB in the ujs test server 2020-10-06 12:14:22 -07:00
Matthew Draper
287920ca7d Respect ENV variables when finding DBs etc for the test suite
If they're not set we'll still fall back to localhost, but this makes it
possible to run the tests against a remote Postgres / Redis / whatever.
2019-02-06 01:20:06 +10:30
Patrik Bóna
8e07711d65 Do not enable disabled elements for XHR redirects
Fixes #29473.
2018-09-27 10:59:56 +02:00
Andrew White
31abee0341 Add support for automatic nonce generation for Rails UJS
Because the UJS library creates a script tag to process responses it
normally requires the script-src attribute of the content security
policy to include 'unsafe-inline'.

To work around this we generate a per-request nonce value that is
embedded in a meta tag in a similar fashion to how CSRF protection
embeds its token in a meta tag. The UJS library can then read the
nonce value and set it on the dynamically generated script tag to
enable it to execute without needing 'unsafe-inline' enabled.

Nonce generation isn't 100% safe - if your script tag is including
user generated content in someway then it may be possible to exploit
an XSS vulnerability which can take advantage of the nonce. It is
however an improvement on a blanket permission for inline scripts.

It is also possible to use the nonce within your own script tags by
using `nonce: true` to set the nonce value on the tag, e.g

    <%= javascript_tag nonce: true do %>
      alert('Hello, World!');
    <% end %>

Fixes #31689.
2018-02-19 15:59:34 +00:00
Kir Shatrov
424117281e Use frozen string literal in actionview/ 2017-07-24 11:53:43 +03:00
Matthew Draper
87b3e226d6 Revert "Merge pull request #29540 from kirs/rubocop-frozen-string"
This reverts commit 3420a14590, reversing
changes made to afb66a5a59.
2017-07-02 02:15:17 +09:30
Kir Shatrov
cfade1ec7e Enforce frozen string in Rubocop 2017-07-01 02:11:03 +03:00
Rafael Mendonça França
fe4a5706ac
Test rails-ujs in our travis matrix 2017-02-22 13:49:28 -05:00
Rafael Mendonça França
010e246756
Fix Rubocop violations and fix documentation visibility
Some methods were added to public API in
5b14129d8d and they should be not part of
the public API.
2016-12-28 21:53:51 -05:00
yuuji.yaginuma
d71f289fb2 stop using removed render :text
Follow up to 79a5ea9ead
2016-12-03 15:28:59 +09:00
Guillermo Iguaran
02568801e6 Add UJS tests 2016-11-26 01:23:07 -05:00