Skip to content

Commit 76bd049

Browse files
committed
fix(demo): revert interceptor trimEnd change, normalizeUrl alone fixes consistency
The trailing slash normalization in normalizeUrl is sufficient to ensure consistent behavior between manual URL entry and button clicks. The interceptor should keep matching exact URLs without trailing slash.
1 parent e2108fd commit 76bd049

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

demo-shared/src/commonMain/kotlin/io/github/kdroidfilter/webview/demo/DemoRequestInterceptor.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ internal class DemoRequestInterceptor(
2121
return WebRequestInterceptResult.Reject
2222
}
2323

24-
if (url.trimEnd('/') == "https://example.com" || url.trimEnd('/') == "https://www.example.com") {
24+
if (url == "https://example.com" || url == "https://www.example.com") {
2525
val rewritten = "https://httpbin.org/anything?from=interceptor&original=" + uriEncodeComponent(url)
2626
onLog("interceptor: rewrite $url -> $rewritten")
2727
val modified =

0 commit comments

Comments
 (0)