# Embedding comment in another site does not support case-sensitive URLs

**URL:** <https://meta.discourse.org/t/embedding-comment-in-another-site-does-not-support-case-sensitive-urls/117390>\
**Category:** Bug\
**Created:** [10.Май.2019 13:24:02 UTC](https://meta.discourse.org/t/embedding-comment-in-another-site-does-not-support-case-sensitive-urls/117390 "2019-05-10T13:24:02Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![agiletortoise](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/agiletortoise/32/139604_2.png) [@agiletortoise](https://meta.discourse.org/u/agiletortoise)\
**Post date:** [10.Май.2019 13:24:02 UTC](https://meta.discourse.org/t/embedding-comment-in-another-site-does-not-support-case-sensitive-urls/117390/1 "2019-05-10T13:24:02Z")

</div>

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](https://github.com/discourse/discourse/blob/acd1693dac1bff6ff50250d942134bc48a27ff14/public/javascripts/embed.js) file, which currently reads:

```js
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.

```js
function normalizeUrl(url) {
    return url.replace(/^https?(\:\/\/)?/, '');
}

```

Thoughts?

---

_[View the full topic](https://meta.discourse.org/t/embedding-comment-in-another-site-does-not-support-case-sensitive-urls/117390)._
