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

Add better url checks #731

Merged
merged 3 commits into from
Feb 2, 2017
Merged

Add better url checks #731

merged 3 commits into from
Feb 2, 2017

Conversation

tofi86
Copy link
Collaborator

@tofi86 tofi86 commented Dec 28, 2016

Add new Warning(RSC-023) when host of HTTP-URL is null (fixes #708).

Catches URL typos like https:/www or https:www


Plus: also report HTTPS URLs in the list of references (c3c9204)

@tofi86 tofi86 added the type: improvement The issue suggests an improvement of an existing feature label Dec 28, 2016
@tofi86 tofi86 added this to the Next milestone Dec 28, 2016
@tofi86 tofi86 self-assigned this Dec 28, 2016
@tofi86 tofi86 requested a review from rdeltour December 28, 2016 17:20
@tofi86
Copy link
Collaborator Author

tofi86 commented Feb 1, 2017

@rdeltour can you do a quick review soon as this blocks #650 rebase?

@@ -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.
Copy link
Member

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.

Copy link
Collaborator Author

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

Copy link
Member

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 ;-)

Copy link
Collaborator Author

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?

@tofi86
Copy link
Collaborator Author

tofi86 commented Feb 2, 2017

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: improvement The issue suggests an improvement of an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enhanced URL checks
2 participants