Closed Bug 1201079 Opened 5 years ago Closed 5 years ago

Stop appending a forward slash to every URL

Categories

(Firefox for iOS :: General, defect)

All
iOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
Tracking Status
fxios-v1.1 --- fixed
fxios 1.0.5+ ---

People

(Reporter: aaronmt, Assigned: st3fan)

Details

Attachments

(2 files)

Every URL has a superfluous forward slash shown in the address-bar.
This is because we dump the URL directly, which has the path. We might be able to simplify.
Assignee: nobody → sarentz
This patch makes sure that we do not display a trailing slash for an `NSURL` that has an empty (`/`) or `nil` path component.

If the `NSURL` contains a non-empty path that ends with a trailing slash then we do not do anything. This is because that will actually result in a different URL. So for example `http://www.apple.com/iphone/` will not be changed. This is the same as *Firefox Desktop* handles it.

I have merged this logic in `absoluteStringWithoutHTTPScheme`, which is called by the `BrowserLocationView.updateTextWithURL()` to update the currently displayed URL. Because this now does more than just remove the `http://` part, I have renamed that function to `absoluteDisplayString`.

Also included tests to make sure this works on URLs with and without trailing slashes with both empty and non-empty path compoments.
Attachment #8658422 - Flags: review?(bnicholson)
Attachment #8658422 - Flags: feedback?(aaron.train)
Attachment #8658422 - Flags: review?(sleroux)
Status: NEW → ASSIGNED
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Still see this on master (89db3d3)

Test URLs: aaronmt.com, polygon.com, ip9.com
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
(In reply to Aaron Train [:aaronmt] from comment #5)
> Still see this on master (89db3d3)
> 
> Test URLs: aaronmt.com, polygon.com, ip9.com

Ok, just noticed this landed on 'v1.0'. I'll check back again.
Status: REOPENED → RESOLVED
Closed: 5 years ago5 years ago
Resolution: --- → FIXED
Same as https://github.com/mozilla/firefox-ios/pull/1046 but converted to Swift 2.0 for the master branch.
Attachment #8658796 - Flags: review?
Comment on attachment 8658796 [details] [review]
PR: https://github.com/mozilla/firefox-ios/pull/1051

Usually safe to just land these uplifts without additional review (unless rebasing required significant changes).
Attachment #8658796 - Flags: review? → review+
https://github.com/mozilla/firefox-ios/pull/1051 still not merged?

I see this on master still
Flags: needinfo?(sarentz)
Flags: needinfo?(bnicholson)
Attachment #8658422 - Flags: feedback?(aaron.train)
You need to log in before you can comment on or make changes to this bug.