-
Notifications
You must be signed in to change notification settings - Fork 659
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle opaque URIs in PaymentAuthWebViewClient (#1428)
`Uri#getQueryParameterNames()` throws an exception on opaque URIs (e.g. mailto:[email protected]).
- Loading branch information
1 parent
ae06ebe
commit 7f9d1cb
Showing
2 changed files
with
15 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -112,4 +112,14 @@ public void onPageFinished_witRedirectCompleteUrl_shouldFinish() { | |
"https://hooks.stripe.com/redirect/complete/src_1ExLWoCRMbs6FrXfjPJRYtng"); | ||
verify(mActivity).finish(); | ||
} | ||
|
||
@Test | ||
public void shouldOverrideUrlLoading_withOpaqueUri_shouldNotCrash() { | ||
final String deepLink = "mailto:[email protected]?payment_intent=pi_123&" + | ||
"payment_intent_client_secret=pi_123_secret_456&source_type=card"; | ||
final PaymentAuthWebView.PaymentAuthWebViewClient paymentAuthWebViewClient = | ||
new PaymentAuthWebView.PaymentAuthWebViewClient(mActivity, mProgressBar, | ||
"pi_123_secret_456", null); | ||
paymentAuthWebViewClient.shouldOverrideUrlLoading(mWebView, deepLink); | ||
} | ||
} |