Skip to content

Commit

Permalink
simlified condition for url encoder difference in api through inverti…
Browse files Browse the repository at this point in the history
…ng the condition
  • Loading branch information
mohitpubnub committed Jan 22, 2024
1 parent 1ed5218 commit a71fb7e
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions pubnub/lib/src/dx/_utils/signature.dart
Original file line number Diff line number Diff line change
Expand Up @@ -57,17 +57,4 @@ ${'$body' == 'null' ? '' : '$body'}''';
}

String encodePathSegament(String pathSegment) =>
Uri.encodeComponent(pathSegment).replaceAllMapped(
RegExp('%3D|%2B|%3A|%2A|%2C|%40|%24|%26|%28|%29'),
(match) => {
'%3D': '=',
'%2B': '+',
'%3A': ':',
'%2A': '*',
'%2C': ',',
'%40': '@',
'%24': '\$',
'%26': '&',
'%28': '(',
'%29': ')',
}[match.group(0)]!);
Uri.encodeFull(pathSegment).replaceAll('/', '%2F').replaceAll('#', '%23');

0 comments on commit a71fb7e

Please sign in to comment.