Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Canonical "Error: Field value must be a URI (e.g. beginning with 'mailto:')" #53

Closed
bwbroersma opened this issue Jun 6, 2023 · 2 comments

Comments

@bwbroersma
Copy link
Contributor

Just noticed a security.txt Canonical-field without an URI scheme (just www.), the error kind of hints on a mailto: scheme. This kind of confused me, because Canonical should only start with https://, right?

See:

uri_fields = [
"acknowledgments",
"canonical",
"contact",
"encryption",
"hiring",
"policy",
"csaf",
]

and:

sectxt/sectxt/__init__.py

Lines 197 to 205 in 79bb386

if key in self.uri_fields:
url_parts = urlsplit(value)
if url_parts.scheme == "":
self._add_error(
"no_uri",
"Field value must be a URI (e.g. beginning with 'mailto:').",
)
elif url_parts.scheme == "http":
self._add_error("no_https", "Web URI must begin with 'https://'.")

@DigitalTrustCenter
Copy link
Owner

We agree that the error message is confusion in situations other than maybe for the contact field. Our solution will be to remove the example in the error message. So the error message would become Field value must be a valid URI. We will implement this change with a new release when we make one. Will leave the issue open for now.

@DigitalTrustCenter
Copy link
Owner

This issue has been handled in the new release. The error message is simplified.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants