Priyansh Saxena commited on
Commit
da16287
·
1 Parent(s): e1b869e

FIX: Avoid mixed-content by using root_path static URLs in template

Browse files
Files changed (1) hide show
  1. templates/index.html +3 -2
templates/index.html CHANGED
@@ -14,7 +14,8 @@
14
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/github-dark.min.css" id="hljs-theme">
15
  <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js"></script>
16
  <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.0/css/all.min.css" rel="stylesheet">
17
- <link rel="stylesheet" href="{{ request.url_for('static', path='styles.css') }}">
 
18
  </head>
19
  <body>
20
  <!-- Toast notification -->
@@ -119,6 +120,6 @@
119
  </main>
120
  </div>
121
 
122
- <script src="{{ request.url_for('static', path='app.js') }}"></script>
123
  </body>
124
  </html>
 
14
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/github-dark.min.css" id="hljs-theme">
15
  <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js"></script>
16
  <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.0/css/all.min.css" rel="stylesheet">
17
+ {% set root_path = request.scope.get('root_path', '').rstrip('/') %}
18
+ <link rel="stylesheet" href="{{ root_path }}/static/styles.css">
19
  </head>
20
  <body>
21
  <!-- Toast notification -->
 
120
  </main>
121
  </div>
122
 
123
+ <script src="{{ root_path }}/static/app.js"></script>
124
  </body>
125
  </html>