-
Notifications
You must be signed in to change notification settings - Fork 402
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
Add better url checks #731
Conversation
catches URL typos like `https:/www` or `https:www`
@@ -293,6 +293,7 @@ RSC_019=EPUBs with Multiple Renditions should contain a META-INF/metadata.xml fi | |||
RSC_020='%1$s' is not a valid URI. | |||
RSC_021=A Search Key Map Document must point to Content Documents ('%1$s' was not found in the spine). | |||
RSC_022=Cannot check image details (requires Java version 7 or higher). | |||
RSC_023='%1$s' is not a valid URL. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wouldn't say "is not a valid URL", since technically it is (it's just that the host component is empty).
What about something more explicit along the lines of: URL '%1$s' has no host component
? (or, maybe more user friendly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, you're right, that's technically wrong. I was trying to phrase this more user friendly.
URL '%1$s' has no host component
is technically correct, but probably hard to understand for non-geeks... ;-)
If we phrase it more technical I would like to add something like …component. Probably misspelled or missing http(s):// ?
. But I'm not sure whether this makes for a good warning message...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, not sure what's the most understandable option... (my useless 2 cents ;-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, technically it's not the host component which is missing. The URI
parser just can't identify it.
Technically it's just a missing /
or two. That's the only cases where RSC_023
is triggered. For https:/www.yout
and for https:www.yout
.
All the other cases are covered by RSC_020 or HTM_025.
So I suggest we just say exactly that: There's a missing slash after the protocol/schema of the URL. protocol is probably more known to non-geeks, right?
RSC_023=The URL '%1$s' is missing one or two slashes '/' after the protocol '%2$s:'
> The URL 'https:/www.youtube.com' is missing one or two slashes '/' after the protocol 'https:'
We could even go further and say:
RSC_023=The URL '%1$s' is missing %2$d slash(es) '/' after the protocol '%3$s:'
> The URL 'https:/www.youtube.com' is missing 1 slash(es) '/' after the protocol 'https:'
What do you think?
I rephrased the message according to my last suggestion. @rdeltour what do you think? are you okay with that? |
Add new Warning(RSC-023) when host of HTTP-URL is null (fixes #708).
Catches URL typos like
https:/www
orhttps:www
Plus: also report HTTPS URLs in the list of references (c3c9204)