File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed
libraries/exoplayer_rtsp/src
main/java/androidx/media3/exoplayer/rtsp
test/java/androidx/media3/exoplayer/rtsp Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -194,7 +194,7 @@ public static Uri removeUserInfo(Uri uri) {
194
194
}
195
195
196
196
// The Uri must include a "@" if the user info is non-null.
197
- String authorityWithUserInfo = checkNotNull (uri .getAuthority ());
197
+ String authorityWithUserInfo = checkNotNull (uri .getEncodedAuthority ());
198
198
checkArgument (authorityWithUserInfo .contains ("@" ));
199
199
String authority = Util .split (authorityWithUserInfo , "@" )[1 ];
200
200
return uri .buildUpon ().encodedAuthority (authority ).build ();
Original file line number Diff line number Diff line change @@ -449,6 +449,13 @@ public void removeUserInfo_withNoUserInfo() {
449
449
.isEqualTo (Uri .parse ("rtsp://foo.bar:5050/foo.mkv" ));
450
450
}
451
451
452
+ @ Test
453
+ public void removeUserInfo_withEncodedAtInUserInfo () {
454
+ Uri uri = Uri .parse ("rtsp://user%40name:pass@foo.bar/foo.mkv" );
455
+ assertThat (RtspMessageUtil .removeUserInfo (uri ))
456
+ .isEqualTo (Uri .parse ("rtsp://foo.bar/foo.mkv" ));
457
+ }
458
+
452
459
@ Test
453
460
public void parseContentLengthHeader_withContentLengthOver31Bits_succeeds () throws Exception {
454
461
String line = "Content-Length: 1000000000000000" ;
You can’t perform that action at this time.
0 commit comments