Skip to content

EmbedBuilder#setTitle does not allow a URL without a TLD (ex. localhost) if it has no file extension #699

@queer

Description

@queer

General Troubleshooting

Hey there! Before you report a bug or suggest a new feature,
please make sure to follow these steps first!

  • I have checked for similar issues.
  • I have updated to the latest JDA version.
  • I have checked the branches or the maintainers' PRs for upcoming features/bug fixes.

This is not the place to learn Java. Please refer to StackOverflow
for your general programming questions.

Issue

Issue Type

  • Bug Report
  • Feature Request

For questions join the official JDA discord server: https://discord.gg/0hMr4ce0tIl3SLv5

Description

Like title says. Attempting to build an embed with EmbedBuilder and setting the embed title URL to something like http://localhost/whatever fails. This is because the URL_PATTERN used expects some sort of TLD or file extension on the end.

https://github.com/DV8FromTheWorld/JDA/blob/3092875bd5fd1eec10f4973a34a13ab6b4170c6e/src/main/java/net/dv8tion/jda/core/EmbedBuilder.java#L43

Using a URL like this would be useful in the case of testing locally. I do know that you can use a hosts file entry like 127.0.0.1 localhost.localdomain (and that's what I started doing), but it would be nice to not have to do this.

Regex101 example showing this: https://regex101.com/r/A567ut/1/

Metadata

Metadata

Assignees

No one assigned

    Labels

    buglevel: noviceis doable as a java/jda novicestatus: completedhas been completed but is not yet released

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions