Skip to content

Commit eac99dc

Browse files
authored
Add a note that SRI only works over HTTPS
Add a note that the SRI attribute is only applied when the Rails app is served over HTTPS. This is something that tripped me up initially, as most browsers treat localhost as a secure origin. Source: fdb0df6
1 parent 7fa2b4d commit eac99dc

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,8 @@ javascript_include_tag :application, integrity: true
158158
# => "<script src="/assets/application.js" integrity="sha256-TvVUHzSfftWg1rcfL6TIJ0XKEGrgLyEq6lEpcmrG9qs="></script>"
159159
```
160160

161+
Note that sprockets-rails only adds integrity hashes to assets when served over an HTTPS connection.
162+
161163

162164
## Contributing to Sprockets Rails
163165

0 commit comments

Comments
 (0)