[PR #865] [MERGED] Additional URI parsing fix #2625

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

📋 Pull Request Information

Original PR: https://github.com/bitwarden/android/pull/865
Author: @mpbw2
Created: 4/30/2020
Status: Merged
Merged: 4/30/2020
Merged by: @mpbw2

Base: masterHead: bugfix-uriparsing


📝 Commits (2)

📊 Changes

2 files changed (+11 additions, -11 deletions)

View changed files

📝 src/Android/Accessibility/AccessibilityHelpers.cs (+5 -5)
📝 src/Core/Utilities/CoreHelpers.cs (+6 -6)

📄 Description

Ran across an issue introduced by recent modifications where an expected failure did in fact, not fail, resulting in a 'no matches found' condition (calling Uri.TryCreate on a URL without a scheme worked, and passed along a scheme-less URI until it was rejected by subsequent code).

The solution (which lines up better with previous code) is to perform the http(s) scheme check / prefix creation first, and if not necessary then fall back to attempting to create the URI with the string as-is. This results in the scheme-less URI being properly prefixed with http://. Also tested with the URLs fixed by our recent changes, and they still work properly.

I'm unsure why we didn't see this while testing the recent changes. For reference, the uriString that exposed this was rqpc45.synology.me:5000


🔄 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/865 **Author:** [@mpbw2](https://github.com/mpbw2) **Created:** 4/30/2020 **Status:** ✅ Merged **Merged:** 4/30/2020 **Merged by:** [@mpbw2](https://github.com/mpbw2) **Base:** `master` ← **Head:** `bugfix-uriparsing` --- ### 📝 Commits (2) - [`73675f3`](https://github.com/bitwarden/android/commit/73675f359f69a46c2ea11659bdf5fd02f4b60a65) Additional URI parsing fix - [`fa0c454`](https://github.com/bitwarden/android/commit/fa0c45452a1cf58dd1224e03768ab7b2e5b8ba81) name cleanup ### 📊 Changes **2 files changed** (+11 additions, -11 deletions) <details> <summary>View changed files</summary> 📝 `src/Android/Accessibility/AccessibilityHelpers.cs` (+5 -5) 📝 `src/Core/Utilities/CoreHelpers.cs` (+6 -6) </details> ### 📄 Description Ran across an issue introduced by recent modifications where an expected failure did in fact, not fail, resulting in a 'no matches found' condition (calling `Uri.TryCreate` on a URL without a scheme worked, and passed along a scheme-less URI until it was rejected by subsequent code). The solution (which lines up better with previous code) is to perform the http(s) scheme check / prefix creation _first_, and if not necessary _then_ fall back to attempting to create the URI with the string as-is. This results in the scheme-less URI being properly prefixed with `http://`. Also tested with the URLs fixed by our recent changes, and they still work properly. I'm unsure why we didn't see this while testing the recent changes. For reference, the uriString that exposed this was `rqpc45.synology.me:5000` --- <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:21:52 -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#2625