Commit 419412a
authored
Add ASCII sanitization utility for HTTP header compatibility (#1596)
* fix: sanitize header content
* chore: Remove unnecessary comment
Removes a redundant `/**/` comment from the `buildUserAgent` function in `HeadersUtil.kt`.
* Refactor: Optimize header sanitization regex
This commit optimizes the `sanitize` function in `HeadersUtil` by extracting the regex for non-ASCII characters into a pre-compiled `private val`. This avoids recompiling the regular expression on every invocation of the function, improving performance.
Additionally, detailed KDoc has been added to the `sanitize` function to better explain its purpose and behavior, including examples of character decomposition.1 parent b9c9ceb commit 419412a
File tree
1 file changed
+17
-1
lines changed- stream-video-android-core/src/main/kotlin/io/getstream/video/android/core/header
1 file changed
+17
-1
lines changedLines changed: 17 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
| |||
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
| 36 | + | |
35 | 37 | | |
36 | 38 | | |
37 | 39 | | |
| |||
81 | 83 | | |
82 | 84 | | |
83 | 85 | | |
84 | | - | |
| 86 | + | |
85 | 87 | | |
86 | 88 | | |
87 | 89 | | |
| |||
96 | 98 | | |
97 | 99 | | |
98 | 100 | | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
99 | 115 | | |
0 commit comments