Переглянути джерело

update from justpy fork: favicon urls

Rodja Trappe 3 роки тому
батько
коміт
99e99d1c07

+ 1 - 1
nicegui/static/templates/favicon.html

@@ -17,7 +17,7 @@
     {% if page_options.favicon.startswith('http') %}
         <link rel="shortcut icon" href={{ page_options.favicon }}>
     {% else %}
-        <link rel="shortcut icon" href={{ request.headers.get('X-Forwarded-Prefix','') + options.static_name + '/' + page_options.favicon }}>
+        <link rel="shortcut icon" href={{ options.static_name + '/' + page_options.favicon }}>
     {% endif %}
 {% else %}
     <link rel="shortcut icon" href='https://elimintz.github.io/favicon.png'>

+ 1 - 1
nicegui/static/templates/js/event_handler.js

@@ -164,7 +164,7 @@ function send_to_server(e, event_type, debug_flag) {
                     var link = document.querySelector("link[rel*='icon']") || document.createElement('link');
                     link.type = 'image/x-icon';
                     link.rel = 'shortcut icon';
-                    link.href = '{{ url_for(options.static_name, path=' / ') }}' + msg.page_options.favicon;
+                    link.href = '{{ options.static_name + '/' }}' + msg.page_options.favicon;
                     document.getElementsByTagName('head')[0].appendChild(link);
                 }
                 if (msg) app1.justpyComponents = msg.data;

+ 1 - 1
nicegui/static/templates/main.html

@@ -124,7 +124,7 @@
                         if (msg.page_options.favicon.startsWith('http')) {
                             link.href = msg.page_options.favicon;
                         } else {
-                            link.href = '{{ url_for(options.static_name, path='/') }}' + msg.page_options.favicon;
+                            link.href = '{{ options.static_name + '/' }}' + msg.page_options.favicon;
                         }
                         document.getElementsByTagName('head')[0].appendChild(link);
                     }