Defect #32891

Bookmark link on project page should not use full path with hostname

Added by Dmitry Makurin 9 months ago. Updated 7 months ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:Jean-Philippe Lang% Done:

0%

Category:Projects
Target version:4.1.1
Resolution:Fixed Affected version:

Description

Currently bookmark url creating with default protocol. If rails server setup with secure protocol bookmarks link still creating with http.
Jquery raises error on that kind of links:

jquery-2.2.4-ui-1.11.0-ujs-5.2.3.js?1574665137:24 Mixed Content: The page at 'https://redmine/projects/1' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://redmine/projects/1/bookmark'. This request has been blocked; the content must be served over HTTPS.

Redmine provides an option to specify protocol in administration panel. It could be used to generate url:

--- app/helpers/projects_helper.rb    (revision 1e830ee09f28f68d9019590e72b3612950724253)
+++ app/helpers/projects_helper.rb    (revision 24843626abc3f32e8fe206689e8d3d728e610a50)
@@ -158,7 +158,7 @@
       method = "post" 
       text = l(:button_project_bookmark)
     end
-    url = bookmark_project_url(project)
+    url = bookmark_project_url(project, :protocol => Setting.protocol)
     link_to text, url, remote: true, method: method, class: css
   end

Associated revisions

Revision 19530
Added by Jean-Philippe Lang 8 months ago

Don't use full path links with hostname

Revision 19656
Added by Jean-Philippe Lang 7 months ago

Merged r19530 to 4.1-stable (#32891).

History

#1 Updated by Dmitry Makurin 9 months ago

I messed up with title a little bit. Bookmark link on project page.

#2 Updated by Marius BALTEANU 8 months ago

  • Status changed from New to Resolved
  • Assignee set to Jean-Philippe Lang
  • Target version set to 4.1.1

r19530 should fix this issue.

#3 Updated by Marius BALTEANU 8 months ago

  • Subject changed from Bookmark link in project jump box to Bookmark link on project page

#4 Updated by Go MAEDA 8 months ago

  • Category set to Projects

#5 Updated by Jean-Philippe Lang 7 months ago

  • Status changed from Resolved to Closed
  • Resolution set to Fixed

Merged.

#6 Updated by Jean-Philippe Lang 7 months ago

  • Subject changed from Bookmark link on project page to Bookmark link on project page should not use full path with hostname

Also available in: Atom PDF