Skip to content

Commit

Permalink
[deep link] Ignore invalid aasa paths (path is null or empty, but has…
Browse files Browse the repository at this point in the history
… a queryParams) (flutter#8339)

* ignore invalid aasa path

* Update deep_links_services.dart

* isNullOrEmpty
  • Loading branch information
hannah-hyj authored Sep 27, 2024
1 parent fefdb57 commit b29a37e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import 'dart:convert';
import 'package:flutter/foundation.dart';
import 'package:http/http.dart';

import '../../shared/primitives/utils.dart';
import 'deep_links_model.dart';

const _apiKey = 'AIzaSyCf_2E9N2AUZR-YSnZTQ72YbCNhKIskIsw';
Expand Down Expand Up @@ -212,6 +213,10 @@ class DeepLinksService {
?.cast<Map<String, Object?>>();
if (aasaPaths != null) {
for (final aasaPath in aasaPaths) {
final path = aasaPath[_pathKey] as String?;
if (path.isNullOrEmpty) {
continue;
}
final rawQueryParams = (aasaPath[_queryParamsKey] as List?)
?.cast<Map<String, Object?>>();
final queryParams = <String, String>{
Expand All @@ -220,7 +225,7 @@ class DeepLinksService {
};
paths.putIfAbsent(domainName, () => <Path>[]).add(
Path(
path: aasaPath[_pathKey] as String,
path: path!,
queryParams: queryParams,
isExcluded:
aasaPath[_isExcludedKey] as bool? ?? false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,16 @@ const iosValidationResponseWithNoError = '''
],
"isCaseSensitive": true,
"isPercentEncoded": true
},
{
"queryParams": [
{
"key": "dplnk",
"value": "?*"
}
],
"isCaseSensitive": true,
"isPercentEncoded": true
}
]
}
Expand Down

0 comments on commit b29a37e

Please sign in to comment.