[PR #4203] [MERGED] PM-13848 Handle URIs with ports and host matching #4772

Closed
opened 2025-11-26 23:49:33 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/bitwarden/android/pull/4203
Author: @dseverns-livefront
Created: 10/30/2024
Status: Merged
Merged: 11/5/2024
Merged by: @dseverns-livefront

Base: mainHead: PM-13948/uri-with-port-and-host-matching


📝 Commits (7)

  • ded3c7c If a uri string does not contain a scheme but has a host and port, the host will mistakenly get parsed as the scheme, we need to append one in these cases
  • e45aeab fix test and move check to be specific to host check
  • 4493dcf add check to other areas where URI parsing can give false negatives and add tests
  • 2616e9e test
  • 4f6a627 a lil refactor
  • ff25a4d doc public function
  • 064eb44 add scheme is necessady on domain matching

📊 Changes

4 files changed (+138 additions, -3 deletions)

View changed files

📝 app/src/main/java/com/x8bit/bitwarden/data/platform/util/StringExtensions.kt (+12 -3)
📝 app/src/main/java/com/x8bit/bitwarden/data/platform/util/URIExtensions.kt (+21 -0)
📝 app/src/test/java/com/x8bit/bitwarden/data/util/StringExtensionsTest.kt (+70 -0)
📝 app/src/test/java/com/x8bit/bitwarden/data/util/UriExtensionsTest.kt (+35 -0)

📄 Description

🎟️ Tracking

https://bitwarden.atlassian.net/browse/PM-13948

📔 Objective

  • If a port was specified with no scheme, the URI was not parsing the string correctly and was using the host as the scheme

📸 Screenshots

before:

https://github.com/user-attachments/assets/a0248aeb-e46f-49ac-8ae1-54b5306a7828

After:

https://github.com/user-attachments/assets/927c4711-0a73-4d4f-beee-35331533a65a

Reminders before review

  • Contributor guidelines followed
  • All formatters and local linters executed and passed
  • Written new unit and / or integration tests where applicable
  • Used internationalization (i18n) for all UI strings
  • CI builds passed
  • Communicated to DevOps any deployment requirements
  • Updated any necessary documentation or informed the documentation team

🦮 Reviewer guidelines

  • 👍 (:+1:) or similar for great changes
  • 📝 (:memo:) or ℹ️ (:information_source:) for notes or general info
  • (:question:) for questions
  • 🤔 (:thinking:) or 💭 (:thought_balloon:) for more open inquiry that's not quite a confirmed
    issue and could potentially benefit from discussion
  • 🎨 (:art:) for suggestions / improvements
  • (:x:) or ⚠️ (:warning:) for more significant problems or concerns needing attention
  • 🌱 (:seedling:) or ♻️ (:recycle:) for future improvements or indications of technical debt
  • ⛏ (:pick:) for minor or nitpick changes

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/bitwarden/android/pull/4203 **Author:** [@dseverns-livefront](https://github.com/dseverns-livefront) **Created:** 10/30/2024 **Status:** ✅ Merged **Merged:** 11/5/2024 **Merged by:** [@dseverns-livefront](https://github.com/dseverns-livefront) **Base:** `main` ← **Head:** `PM-13948/uri-with-port-and-host-matching` --- ### 📝 Commits (7) - [`ded3c7c`](https://github.com/bitwarden/android/commit/ded3c7cc63478d4981e7a821d3845efacacce875) If a uri string does not contain a scheme but has a host and port, the host will mistakenly get parsed as the scheme, we need to append one in these cases - [`e45aeab`](https://github.com/bitwarden/android/commit/e45aeab6ba4b5d729ae399a4d29dffb1895c1f07) fix test and move check to be specific to host check - [`4493dcf`](https://github.com/bitwarden/android/commit/4493dcfb4583ab0f49efc0a647298db27c29768f) add check to other areas where URI parsing can give false negatives and add tests - [`2616e9e`](https://github.com/bitwarden/android/commit/2616e9e98dee07581e76cedd7896a288929e4efd) test - [`4f6a627`](https://github.com/bitwarden/android/commit/4f6a6275e5dc8e69e7048576834188bfb80e76d0) a lil refactor - [`ff25a4d`](https://github.com/bitwarden/android/commit/ff25a4d5205704b8eba5f3b8dcfcd12ac5bdc0ef) doc public function - [`064eb44`](https://github.com/bitwarden/android/commit/064eb44987ae354f3fe7d68ef20a96a0db407b54) add scheme is necessady on domain matching ### 📊 Changes **4 files changed** (+138 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `app/src/main/java/com/x8bit/bitwarden/data/platform/util/StringExtensions.kt` (+12 -3) 📝 `app/src/main/java/com/x8bit/bitwarden/data/platform/util/URIExtensions.kt` (+21 -0) 📝 `app/src/test/java/com/x8bit/bitwarden/data/util/StringExtensionsTest.kt` (+70 -0) 📝 `app/src/test/java/com/x8bit/bitwarden/data/util/UriExtensionsTest.kt` (+35 -0) </details> ### 📄 Description ## 🎟️ Tracking https://bitwarden.atlassian.net/browse/PM-13948 <!-- Paste the link to the Jira or GitHub issue or otherwise describe / point to where this change is coming from. --> ## 📔 Objective - If a port was specified with no scheme, the `URI` was not parsing the string correctly and was using the `host` as the `scheme` <!-- Describe what the purpose of this PR is, for example what bug you're fixing or new feature you're adding. --> ## 📸 Screenshots before: https://github.com/user-attachments/assets/a0248aeb-e46f-49ac-8ae1-54b5306a7828 After: https://github.com/user-attachments/assets/927c4711-0a73-4d4f-beee-35331533a65a <!-- Required for any UI changes; delete if not applicable. Use fixed width images for better display. --> ## ⏰ Reminders before review - Contributor guidelines followed - All formatters and local linters executed and passed - Written new unit and / or integration tests where applicable - Used internationalization (i18n) for all UI strings - CI builds passed - Communicated to DevOps any deployment requirements - Updated any necessary documentation or informed the documentation team ## 🦮 Reviewer guidelines <!-- Suggested interactions but feel free to use (or not) as you desire! --> - 👍 (`:+1:`) or similar for great changes - 📝 (`:memo:`) or ℹ️ (`:information_source:`) for notes or general info - ❓ (`:question:`) for questions - 🤔 (`:thinking:`) or 💭 (`:thought_balloon:`) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion - 🎨 (`:art:`) for suggestions / improvements - ❌ (`:x:`) or ⚠️ (`:warning:`) for more significant problems or concerns needing attention - 🌱 (`:seedling:`) or ♻️ (`:recycle:`) for future improvements or indications of technical debt - ⛏ (`:pick:`) for minor or nitpick changes --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2025-11-26 23:49:33 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/android#4772