mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
API: Parse fragment of URI. v5.0.106 (#3295)
* parse fragment of uri * adapt FMLE URL: 'rtmp://ip/app/app2#k=v/stream', then add more test case Co-authored-by: winlin <winlin@vip.126.com>
This commit is contained in:
parent
0e550d496b
commit
c5a0c5947f
6 changed files with 42 additions and 4 deletions
|
@ -3560,6 +3560,33 @@ VOID TEST(ProtocolRTMPTest, RTMPRequest)
|
|||
req.update_auth(&req1);
|
||||
EXPECT_TRUE(NULL != req.args);
|
||||
EXPECT_TRUE(req1.args != req.args);
|
||||
|
||||
param = "";
|
||||
req.stream = "livestream";
|
||||
srs_discovery_tc_url("rtmp://std.ossrs.net/live#b=2",
|
||||
req.schema, req.host, req.vhost, req.app, req.stream, req.port, param);
|
||||
EXPECT_STREQ("#b=2", param.c_str());
|
||||
|
||||
param = "";
|
||||
req.stream = "livestream";
|
||||
srs_discovery_tc_url("rtmp://std.ossrs.net/live?a=1#b=2",
|
||||
req.schema, req.host, req.vhost, req.app, req.stream, req.port, param);
|
||||
EXPECT_STREQ("?a=1#b=2", param.c_str());
|
||||
|
||||
param = "";
|
||||
srs_discovery_tc_url("rtmp://std.ossrs.net/live?a=1&c=3#b=2",
|
||||
req.schema, req.host, req.vhost, req.app, req.stream, req.port, param);
|
||||
EXPECT_STREQ("?a=1&c=3#b=2", param.c_str());
|
||||
|
||||
param = "";
|
||||
srs_discovery_tc_url("rtmp://std.ossrs.net/live?a=1&c=3#b=2#d=4",
|
||||
req.schema, req.host, req.vhost, req.app, req.stream, req.port, param);
|
||||
EXPECT_STREQ("?a=1&c=3#b=2#d=4", param.c_str());
|
||||
|
||||
param = "";
|
||||
srs_discovery_tc_url("rtmp://std.ossrs.net/live?a=1#e=5&c=3#b=2#d=4",
|
||||
req.schema, req.host, req.vhost, req.app, req.stream, req.port, param);
|
||||
EXPECT_STREQ("?a=1#e=5&c=3#b=2#d=4", param.c_str());
|
||||
}
|
||||
|
||||
VOID TEST(ProtocolRTMPTest, RTMPHandshakeBytes)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue