Skip to content
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.

Closes #3871: Autocomplete incorrectly fills urls that contains a port number. #3847

Merged
merged 1 commit into from Jul 23, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -69,7 +69,7 @@ private fun matchSegment(query: String, rawUrl: String): String? {
val url = Uri.parse(rawUrl)
return url.host?.let { host ->
if (host.startsWith(query)) {
host + url.path + url.port.orEmpty()
host + url.port.orEmpty() + url.path
} else {
val strippedHost = host.noCommonSubdomains()
if (strippedHost != url.host) {
Expand Down
Expand Up @@ -23,7 +23,7 @@ class DomainMatcherTest {
"https://en.Wikipedia.org/Wiki/Mozilla",
"http://192.168.254.254:8000", "http://192.168.254.254:8000/admin",
"http://иННая.локаль", // TODO add more test data for non-english locales
"about:config", "about:crashes"
"about:config", "about:crashes", "http://localhost:8080/index.html"
)
// Full url matching.
assertEquals(
Expand Down Expand Up @@ -71,6 +71,11 @@ class DomainMatcherTest {
segmentAwareDomainMatch("192.168.254.254:8000/a", urls)
)

assertEquals(
DomainMatch("http://localhost:8080/index.html", "localhost:8080/index.html"),
segmentAwareDomainMatch("localhost", urls)
)

// About urls.
assertEquals(
DomainMatch("about:config", "about:config"),
Expand Down
3 changes: 3 additions & 0 deletions docs/changelog.md
Expand Up @@ -12,6 +12,9 @@ permalink: /changelog/
* [Gecko](https://github.com/mozilla-mobile/android-components/blob/master/buildSrc/src/main/java/Gecko.kt)
* [Configuration](https://github.com/mozilla-mobile/android-components/blob/master/buildSrc/src/main/java/Config.kt)

* **support-utils**
* Fixed [#3871](https://github.com/mozilla-mobile/android-components/issues/3871) autocomplete incorrectly fills urls that contains a port number.

* **feature-readerview**
* Fixed [#3864](https://github.com/mozilla-mobile/android-components/issues/3864) now minus and plus buttons have the same size on reader view.

Expand Down