Skip to content

使用 HTTPS 访问认证页面时无法建立 WebSocket 连接 #7161

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 25, 2023

Conversation

Zuoqiu-Yingyi
Copy link
Contributor

  • Please commit to the dev branch 请提交到 dev 开发分支
  • For bug fixes, please describe the problem and solution via code comments 对于修复缺陷,请通过代码注释描述问题和解决方案

认证页面的如下语句运算符优先级错误导致使用 https 协议访问时 websocket 的 URL 设置错误(设置为了 wss 而非 wss://host/ws?app=siyuan&id=auth)

new WebSocket(window.location.protocol === 'https:' ? 'wss' : 'ws' + '://' + window.location.host + '/ws?app=siyuan&id=auth')

Sorry, something went wrong.

@88250 88250 changed the title 使用 HTTPS 协议访问认证页面时无法建立 Web Socket 连接 使用 HTTPS 访问认证页面时无法建立 WebSocket 连接 Jan 25, 2023
@88250 88250 added this to the 2.7.1 milestone Jan 25, 2023
@88250 88250 merged commit 3f87f3d into siyuan-note:dev Jan 25, 2023
@Zuoqiu-Yingyi Zuoqiu-Yingyi deleted the dev-auth-ws branch January 25, 2023 13:30
@88250 88250 mentioned this pull request Jan 26, 2023
2 tasks
88250 added a commit that referenced this pull request Jan 26, 2023
@88250
Copy link
Member

88250 commented Jan 26, 2023

用了 $ 的话好像和 golang html template 语法冲突了,导致无法正确渲染页面,我们又调整了一下,麻烦帮忙测试。

@Zuoqiu-Yingyi
Copy link
Contributor Author

用了 $ 的话好像和 golang html template 语法冲突了,导致无法正确渲染页面,我们又调整了一下,麻烦帮忙测试。

应该没啥问题了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants