/uploads: set referrerpolicy=no-referrer on hotlinked previews.
Don't send the referer when hotlinking preview images on the /uploads/new page. Improves user privacy and may bypass anti-hotlinking protections in some cases.
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
<% if params[:url] %>
|
||||
<div id="upload-image">
|
||||
<% if ImageProxy.needs_proxy?(@source.image_url) %>
|
||||
<%= image_tag(image_proxy_uploads_path(:url => @source.image_url), :title => "Preview", :id => "image") %>
|
||||
<%= tag.img src: image_proxy_uploads_path(url: @source.image_url), title: "Preview", id: "image" %>
|
||||
<% elsif @source.image_url.present? %>
|
||||
<%= image_tag(@source.image_url, :title => "Preview", :id => "image") %>
|
||||
<%= tag.img src: @source.image_url, title: "Preview", id: "image", referrerpolicy: "no-referrer" %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user