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: enforce protocol in shortcut urls #11076

Merged
merged 1 commit into from
Jun 20, 2024

Conversation

kulmann
Copy link
Contributor

@kulmann kulmann commented Jun 20, 2024

Description

If the user types a URL without protocol and doesn't click on the proposed URL in the dropdown (which would include https:// as protocol), the resulting .url file wouldn't have a protocol in the URL. This PR fixes that by enforcing https:// as prefix for the user input if none was given. Technically this would've been possible by using unref(dropItemUrl) instead of unref(inputUrl), but I've decided to extract the body of dropItemUrl into a function and use that, because it would be confusing to use dropItemUrl as the final input on confirm.

Related Issue

Motivation and Context

Enforce url protocol so that mobile clients won't have trouble opening the URLs.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Technical debt
  • Tests
  • Documentation
  • Maintenance (e.g. dependency updates or tooling)

@kulmann kulmann force-pushed the enforce-url-protocol-in-shortcuts branch from b80b0a1 to 2d05b92 Compare June 20, 2024 09:47
Copy link
Contributor

@AlexAndBear AlexAndBear left a comment

Choose a reason for hiding this comment

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

Since we add the protocol to the file, we can omit the protocol rewrite in packages/web-pkg/src/composables/actions/files/useFileActionsOpenShortcut.ts

@kulmann
Copy link
Contributor Author

kulmann commented Jun 20, 2024

Since we add the protocol to the file, we can omit the protocol rewrite in packages/web-pkg/src/composables/actions/files/useFileActionsOpenShortcut.ts

I think it still makes sense there. url files which were create with a different application might have been uploaded and not have a protocol in the url, we still want to be able to use them.

@AlexAndBear
Copy link
Contributor

Since we add the protocol to the file, we can omit the protocol rewrite in packages/web-pkg/src/composables/actions/files/useFileActionsOpenShortcut.ts

I think it still makes sense there. url files which were create with a different application might have been uploaded and not have a protocol in the url, we still want to be able to use them.

Got you, but then the initial problem, that has been reported is still an issue on the clients side, when a user does this ;)

Copy link

@kulmann kulmann merged commit 93218cb into stable-8.0 Jun 20, 2024
3 checks passed
@kulmann kulmann deleted the enforce-url-protocol-in-shortcuts branch July 15, 2024 14:46
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.

3 participants