Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 66f7956

Browse filesBrowse files
authored
Merge pull request #25039 from whyvra/fix/update_webagg_js
Updated WebAgg JS to check and send request over wss if using HTTPS
2 parents 16a2970 + 9f2a302 commit 66f7956
Copy full SHA for 66f7956

File tree

Expand file treeCollapse file tree

2 files changed

+6
-3
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+6
-3
lines changed

‎lib/matplotlib/backends/web_backend/all_figures.html

Copy file name to clipboardExpand all lines: lib/matplotlib/backends/web_backend/all_figures.html
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@
2424
figure_div.id = "figure-div";
2525
main_div.appendChild(figure_div);
2626
var websocket_type = mpl.get_websocket_type();
27-
var websocket = new websocket_type("{{ ws_uri }}" + fig_id + "/ws");
27+
var uri = "{{ ws_uri }}" + fig_id + "/ws";
28+
if (window.location.protocol === "https:") uri = uri.replace('ws:', 'wss:')
29+
var websocket = new websocket_type(uri);
2830
var fig = new mpl.figure(fig_id, websocket, mpl_ondownload, figure_div);
2931

3032
fig.focus_on_mouseover = true;

‎lib/matplotlib/backends/web_backend/single_figure.html

Copy file name to clipboardExpand all lines: lib/matplotlib/backends/web_backend/single_figure.html
+3-2Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,9 @@
1919
ready(
2020
function () {
2121
var websocket_type = mpl.get_websocket_type();
22-
var websocket = new websocket_type(
23-
"{{ ws_uri }}" + {{ str(fig_id) }} + "/ws");
22+
var uri = "{{ ws_uri }}" + {{ str(fig_id) }} + "/ws";
23+
if (window.location.protocol === 'https:') uri = uri.replace('ws:', 'wss:')
24+
var websocket = new websocket_type(uri);
2425
var fig = new mpl.figure(
2526
{{ str(fig_id) }}, websocket, mpl_ondownload,
2627
document.getElementById("figure"));

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.