Skip to content
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

“setting”页面里的“个人网站”选项不支持"https://" #132

Closed
meteormatt opened this issue Mar 21, 2013 · 2 comments
Closed

Comments

@meteormatt
Copy link
Contributor

设置页面里的“个人网站”选项不支持https://,
只支持"http://"

bug重现:

  1. 我在个人网站里填入https://meteormatt.net
    2013-03-21 22:55:26
  2. 保存时提示

不正确的个人网站。

2013-03-21 22:54:20

我看了下代码,好像是这行报的错。
https://github.com/cnodejs/nodeclub/blob/master/controllers/user.js#L129

if (url !== '') {
      try {
        if (url.indexOf('http://') < 0) {
          url = 'http://' + url;
        }
        check(url, '不正确的个人网站。').isUrl();
      } catch (e) {

这段代码没有检查https://的情况。
如果是"https://",index<0,反而变成了"http://https://"的情况,造成异常发生。

希望这个bug能够得到修复。
不然,我自己提交一个pull request,增加一个or判断?

@fengmk2
Copy link
Member

fengmk2 commented Mar 21, 2013

非常欢迎提交pr
On Mar 21, 2013 11:34 PM, "Liu Xing" [email protected] wrote:

设置页面里的“个人网站”选项不支持https://,
只支持"http://"

bug重现:

  1. 我在个人网站里填入https://meteormatt.net
    [image: 2013-03-21 22:55:26]https://f.cloud.github.com/assets/424475/286282/750cf7be-9238-11e2-8982-71cd750757eb.png
  2. 保存时提示

不正确的个人网站。

[image: 2013-03-21 22:54:20]https://f.cloud.github.com/assets/424475/286283/7b07ec3c-9238-11e2-9310-f49620362d54.png

我看了下代码,好像是这行报的错。
https://github.com/cnodejs/nodeclub/blob/master/controllers/user.js#L129

if (url !== '') {
try {
if (url.indexOf('http://') < 0) {
url = 'http://' + url;
}
check(url, '不正确的个人网站。').isUrl();
} catch (e) {

这段代码没有检查https://的情况 https://xn--87qz08afnq。
如果是"https://",index<0,反而变成了"http://https://"的情况,造成异常发生。

希望这个bug能够得到修复。
不然,我自己提交一个pull request,增加一个or判断?


Reply to this email directly or view it on GitHubhttps://github.com//issues/132
.

fengmk2 added a commit that referenced this issue Mar 22, 2013
#132 “setting”页面里的“个人网站”选项不支持"https://"
@meteormatt
Copy link
Contributor Author

测试通过,issue关闭。

2013-03-22 10:49:30

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

No branches or pull requests

2 participants