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

解决带域名路径 '//abc.com/xxx' 的情况 #1236

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tglgx
Copy link

@tglgx tglgx commented Feb 9, 2018

No description provided.

@oxUnd
Copy link
Contributor

oxUnd commented Feb 11, 2018

这个是资源寻址的地方啊,跟域名有啥关系?

@tglgx
Copy link
Author

tglgx commented Feb 11, 2018

@xiangshouding ,'//abc.com/xxx' 这个被当做普通路径处理了
目录结构:
├── abc.com 对应站点 abc.com
│  └── index.html
└── cde.com 对应站点 cde.com
   └── script
      └── main.js
这个时候 如果index有一个引用是:

<script src="//cde.com/script/main.js"></script>

经过fis3发布会变成:

<script src="/cde.com/script/main.js"></script>

实际上应该保持

<script src="//cde.com/script/main.js"></script>

才对

@tglgx
Copy link
Author

tglgx commented Feb 11, 2018

@xiangshouding ‘//cde.com/script/main.js’是省略协议头的一种写法,表示和当前页面保持一样的协议,比如访问:'http://abc.com/index.html' 那么‘//cde.com/script/main.js’ 就等价于 ‘http://cde.com/script/main.js’
访问:'https://abc.com/index.html' 那么‘//cde.com/script/main.js’ 就等价于 ‘https://cde.com/script/main.js’

@oxUnd
Copy link
Contributor

oxUnd commented Feb 11, 2018

这是两码事儿,本身系统自带 CDN 的能力,你只关心你的代码就可以了。

如果你非得把路径本身强加太多的概念在里面,那么工具做起来就太臃肿了。

@tglgx
Copy link
Author

tglgx commented Feb 12, 2018

@xiangshouding 这个路径的概念不是我强加的啊,
‘//cde.com/script/main.js’ 这种写法是浏览器本身支持的,
工具把这种写法当做普通路径 ‘/cde.com/script/main.js’ ,
将'//'当做‘/’这个本身就是个Bug吧,
我并没有强加额外的概念进去

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

Successfully merging this pull request may close these issues.

2 participants