# Aangepaste Header Links weigert Matrix URL

**URL:** https://meta.discourse.org/t/custom-header-links-refuses-matrix-url/352433
**Category:** Bug
**Tags:** custom-header-links
**Created:** [15 februari 2025 om 12:16 UTC](https://meta.discourse.org/t/custom-header-links-refuses-matrix-url/352433 "2025-02-15T12:16:36Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![Arkshine](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/arkshine/32/298682_2.png) [@Arkshine](https://meta.discourse.org/u/Arkshine)
#### Post date: [15 februari 2025 om 13:40 UTC](https://meta.discourse.org/t/custom-header-links-refuses-matrix-url/352433/2 "2025-02-15T13:40:30Z")

</div>

The double `#` makes the object setting validation fail in the core (not this TC per se).

`bad URI(is not URI?): "https://matrix.to/#/#matrix-meta-chat:fedoraproject.org" (URI::InvalidURIError)`

It’s not strictly a valid URI, so you’d need to encode the fragment.  
Here; using `https://matrix.to/#/%23matrix-meta-chat:fedoraproject.org` will work.

Looking at the code:  
[https://github.com/discourse/discourse/blob/main/lib/theme\_settings\_object\_validator.rb#L191-L193](https://github.com/discourse/discourse/blob/main/lib/theme_settings_object_validator.rb#L191-L193)  
`is_valid_url` is defined here:

> <https://github.com/discourse/discourse/blob/main/lib/url_helper.rb#L28-L29>

You can see they already have another function to deal with this situation and is being used in other places:

> <https://github.com/discourse/discourse/blob/main/lib/url_helper.rb#L6-L12>

I think it’s reasonable to use `relaxed_parse` for the theme object URL validation.  
E.g.: `if validations&.dig(:url) && !UrlHelper.relaxed_parse?(value)`

---

_[View the full topic](https://meta.discourse.org/t/custom-header-links-refuses-matrix-url/352433)._
