-
-
Notifications
You must be signed in to change notification settings - Fork 113
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
escape uri of path in get_file_path for http(s), ftp(s), dav(s) #792
Conversation
…davs This change aims to import a working path into Kodi if the network shared path is using http, https, ftp, ftps, dav or davs protocol.
Kudos, SonarCloud Quality Gate passed! |
Could you please provide tests for this? A list of expected inputs -> outputs, both what's now which is incorrect, and what's correct would do, I can implement the tests myself. :) |
Sure. Below some examples with https, it is also valid for protocols http, ftp, ftps, dav and davs. Current behavior of path: This results in Kodi trying to open and play "https://myserver.local/TV_Shows/My" or to use a literal ampersand in the URL which my break the call if you are using a webserver. requote_uri passes the given URI through an unquote/quote cycle to ensure that it is fully and consistently quoted. New behavior of path: Moreover, I've been tested this for the past few months, I haven't got any issue. If anything, it strengthens the output to make sure a valid URL is generated for those protocols. |
Btw, #767 is similar so you should be able to close it aswell with this PR. |
Yes, I was planning to. Could you test this with files that actually do contain escape sequences in the file names? Sounds like that might potentially cause issues. |
This comment was marked as abuse.
This comment was marked as abuse.
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
Quality Gate passedIssues Measures |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #792 +/- ##
=======================================
Coverage 21.90% 21.90%
=======================================
Files 63 63
Lines 8634 8637 +3
Branches 1587 1588 +1
=======================================
+ Hits 1891 1892 +1
- Misses 6722 6724 +2
Partials 21 21 ☔ View full report in Codecov by Sentry. |
Quality Gate passedIssues Measures |
This change aims to import a working path into Kodi if the network shared path is using http, https, ftp, ftps, dav or davs protocol.
Currently, if a path contains a space, it is not replaced by %20 and becomes unreadable for Kodi.
requote_uri function ensures that the uri's special characters are properly encoded and passed safely.