Fix smb:/ handling
ClosedPublic

Authored by davidedmundson on Oct 4 2017, 2:35 PM.

Details

Summary

smb:// is a URL with no host and no path
smb:/// is a URL with no host, but a valid path

The current code special cases smb:/ which isn't a real thing.

This results in smb:// falling through checkURL() and being incorrectly
modified into smb:/// creating a URL with a host, something different.

This code makes any smb:/ get converted into smb:// at the right place.
Then the special case for having no host or path are handled properly.

Test Plan

Diff Detail

Repository
R320 KIO Extras
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
davidedmundson created this revision.

update

ngraham added a subscriber: ngraham.Oct 4 2017, 4:56 PM

This looks reasonable to me. As far as I could test smb:/ and smb:// are now handled in the same fashion.

A little sidenote though: Entering even bigger garbage such as smb:ú/ as the address returns a rather cryptic message about an internal error having occurred. Other protocols I tested at least return a sensible error message.

When it comes to SMB support, every little bit helps. Is this commitable in its current state?

IMHO, yes. It fixes use of an invalid URL into a valid URL.

Anything valid is still fine.

ngraham accepted this revision.Oct 18 2017, 3:29 PM
This revision is now accepted and ready to land.Oct 18 2017, 3:29 PM
elvisangelaccio accepted this revision.Oct 18 2017, 9:54 PM

I can't test it, but LGTM.

Can we land this?

This revision was automatically updated to reflect the committed changes.