Merge pull request #1138 from Lavamancer:bugfix/rtsp_message_util_encoded_authority
PiperOrigin-RevId: 674239756
This commit is contained in:
commit
023fd32cb1
@ -46,6 +46,8 @@
|
|||||||
* DASH Extension:
|
* DASH Extension:
|
||||||
* Smooth Streaming Extension:
|
* Smooth Streaming Extension:
|
||||||
* RTSP Extension:
|
* RTSP Extension:
|
||||||
|
* Fix user info removal for URLs that contain encoded @ characters
|
||||||
|
([#1138](https://github.com/androidx/media/pull/1138)).
|
||||||
* Decoder Extensions (FFmpeg, VP9, AV1, etc.):
|
* Decoder Extensions (FFmpeg, VP9, AV1, etc.):
|
||||||
* MIDI extension:
|
* MIDI extension:
|
||||||
* Leanback extension:
|
* Leanback extension:
|
||||||
|
@ -192,7 +192,7 @@ import java.util.regex.Pattern;
|
|||||||
}
|
}
|
||||||
|
|
||||||
// The Uri must include a "@" if the user info is non-null.
|
// The Uri must include a "@" if the user info is non-null.
|
||||||
String authorityWithUserInfo = checkNotNull(uri.getAuthority());
|
String authorityWithUserInfo = checkNotNull(uri.getEncodedAuthority());
|
||||||
checkArgument(authorityWithUserInfo.contains("@"));
|
checkArgument(authorityWithUserInfo.contains("@"));
|
||||||
String authority = Util.split(authorityWithUserInfo, "@")[1];
|
String authority = Util.split(authorityWithUserInfo, "@")[1];
|
||||||
return uri.buildUpon().encodedAuthority(authority).build();
|
return uri.buildUpon().encodedAuthority(authority).build();
|
||||||
|
@ -449,6 +449,12 @@ public final class RtspMessageUtilTest {
|
|||||||
.isEqualTo(Uri.parse("rtsp://foo.bar:5050/foo.mkv"));
|
.isEqualTo(Uri.parse("rtsp://foo.bar:5050/foo.mkv"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void removeUserInfo_withEncodedAtInUserInfo() {
|
||||||
|
Uri uri = Uri.parse("rtsp://user%40name:pass@foo.bar/foo.mkv");
|
||||||
|
assertThat(RtspMessageUtil.removeUserInfo(uri)).isEqualTo(Uri.parse("rtsp://foo.bar/foo.mkv"));
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void parseContentLengthHeader_withContentLengthOver31Bits_succeeds() throws Exception {
|
public void parseContentLengthHeader_withContentLengthOver31Bits_succeeds() throws Exception {
|
||||||
String line = "Content-Length: 1000000000000000";
|
String line = "Content-Length: 1000000000000000";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user