Embedding Discourse comments in another site does not support case-sensitive URLs.
Using the standard embedding instructions provided in the admin interface, under Customize > Embedding, the host site provides the discourseEmbedURL value. If providing case-sensitive URL paths, such as http://site.com/AAA and http://site.com/aaa, the same comment thread will be embedded in both pages.
The root of this issue is in the normalizeURL function in Discourse’s public/javascript/embed.js file, which currently reads:
function normalizeUrl(url) {
return url.toLowerCase().replace(/^https?(\:\/\/)?/, '');
}
I would argue there is no reason to lower case the URL provided. The URL is provided by the host application, which should be able to make decisions about what is considered a unique URL. Removing toLowerCase() should be a non-breaking change that will allow case-sensitive URLs to be supported properly.
function normalizeUrl(url) {
return url.replace(/^https?(\:\/\/)?/, '');
}
Yes, it is. I have case-sensitive identifiers in the URLs in the action directory site I run for my app (example).
In retrospect, I should probably not have used case-senstive IDs, but that’s water under the bridge - would be hard to change now. Used a generator similar to those used for URLs shorteners like bitly (which are also case-sensitive).
I’d agree this could be a problem if it were a case that the user had to enter these URLs, but since the embedding is done programmatically, it doesn’t seem necessary to downcast.
是的。在文件名区分大小写这个问题上,我通常是个强硬派。对于那些懒惰地忽略文件名大小写、导致人们做出愚蠢行为的操作系统,我至少已经愤慨了快三十年了(或者说,至少从1995年我开始开发 Web 应用、那时愚蠢的 Mac 还使用不区分大小写的文件系统开始)。我不太清楚当时发生了什么。那是上午 9 点 43 分,我本该完全清醒,甚至已经喝过咖啡了。也许有人黑了我的账号并代我写了那段话?