当不区分大小写的客户端联系网络服务器时会发生什么?
我刚刚知道某些文件系统(例如 FAT)将文件名存储为大写,无论创建文件时使用的大小写如何。所以不可能将 Bishop.png 和 bishop.png 放在同一个文件夹中,是吗?
如果我有一台 Linux 服务器,并将这两个文件放在一个文件夹中,并且我创建一个如下所示的网页,会发生什么情况:
<html>
<body>
<img src="Bishop.png" />
<img src="bishop.png" />
</body>
</html>
现在 Windows 98 客户端请求此页面(我认为它们只有 FAT)。 Bishop.png 会显示两次吗? bishop.png 会显示两次吗?或者,尽管 Windows 98 无法区分这些文件(如果这些文件存储在本地),但两个图像都会显示吗?
(我无法亲自检查这一点,因为我只有 Linux)
I've just got to know that some filesystems, such as FAT, store filenames as upper-case regardless of the case used to create them. So it's not possible to have Bishop.png and bishop.png in the same folder, is it?
What happens if I have a Linux server with those two files in one folder and I create a webpage like this:
<html>
<body>
<img src="Bishop.png" />
<img src="bishop.png" />
</body>
</html>
Now this page get requested by a Windows 98 client (I think they had only FAT).
Will Bishop.png be displayed twice? Will bishop.png be displayed twice? Or will both images be displayed although Windows 98 couldn't distinguish these files if they were stored locally?
(I don't have any possibility to check this for myself as I only have Linux)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
客户端使用的文件系统应该不重要。它只会使用在 HTML 页面中找到的确切大小写向服务器发送请求,因为 URL 的路径部分根据定义是区分大小写的。如果稍后它想在本地缓存图像,那么它会遇到比字母大小写更大的问题,例如不能将两个不同站点的 bishop.png 相互混淆。解决这些问题通常也需要解决字母大小写问题,即使本地文件系统本身无法做到这一点。
The filesystem used by the client should not matter. It will just send a request to the server using the exact capitalization it finds in the HTML page, since the path part of URLs is case-sensitive by definition. If later it wants to cache the image locally, it has greater problems than letter case, such as not confusing bishop.png's from two different sites with each other. Solving those problems will in general entail a solution to letter case too, even if the local filesystem cannot do it by itself.