[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
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

Fix scheme detection for external links #11942

Merged
merged 1 commit into from
Jun 1, 2024

Conversation

ziz57
Copy link
Contributor
@ziz57 ziz57 commented May 31, 2024

Following RFC 3986.

The previous code failed on URIs like "about:foo", and on links containing upper case in the scheme.


This change is Reviewable

@ziz57 ziz57 force-pushed the registerLinkScheme branch from 3ea0233 to b1b6a13 Compare May 31, 2024 23:03
local scheme = link_url:match("^(%w+)://")
local is_handled_external_link = scheme and util.arrayContains(self.handledSchemes, scheme)
local scheme = link_url:match("^(%w[%w+%-.]*):")
local is_handled_external_link = scheme and util.arrayContains(self.handledSchemes, scheme:lower())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a bit too late to comment on the first PR, so doing it on the second :)
"handled" sounds to me like "done being processed".
"supported" would read less strange, like "we can process it, we'll do that later".

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose I said something similar in #11889 (comment)

But handled can make sense as well because passing it off to the system doesn't include much supporting for example. I haven't double checked what all the specific behaviors are right now though.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, "supported" is good. Done.

@Frenzie Frenzie merged commit 93407c8 into koreader:master Jun 1, 2024
3 checks passed
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

Successfully merging this pull request may close these issues.

4 participants