Skip to content

Commit c5bb3af

Browse files
committed
fix: build RTSP request-line URL without userinfo using Uri components
1 parent e30bf16 commit c5bb3af

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

app/src/main/java/com/openipc/decoder/Decoder.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -881,7 +881,10 @@ private void rtspConnect() throws Exception {
881881
}
882882
// Strip userinfo from the request-line URL: credentials belong only in the
883883
// Authorization header — including them in the URL leaks them to server access logs.
884-
String rtspUrl = uri.buildUpon().userInfo(null).build().toString();
884+
String path = uri.getEncodedPath();
885+
String rtspUrl = uri.getScheme() + "://" + host
886+
+ (port >= 0 ? ":" + port : "")
887+
+ (path != null ? path : "");
885888

886889
int seq = 1;
887890
String desc = "DESCRIBE " + rtspUrl + " RTSP/1.0\r\n" +

0 commit comments

Comments
 (0)