mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
Forward add question mark to the end. v6.0.30 (#3438)
Co-authored-by: pengfei.ma <pengfei.ma@ctechm.com> Co-authored-by: chundonglinlin <chundonglinlin@163.com>
This commit is contained in:
parent
67867242fc
commit
dc7be76bb1
4 changed files with 32 additions and 3 deletions
|
@ -8,6 +8,7 @@ The changelog for SRS.
|
||||||
|
|
||||||
## SRS 6.0 Changelog
|
## SRS 6.0 Changelog
|
||||||
|
|
||||||
|
* v6.0, 2023-02-25, Merge [#3438](https://github.com/ossrs/srs/pull/3438): Forward add question mark to the end. v6.0.30 (#3438)
|
||||||
* v6.0, 2023-02-25, Merge [#3416](https://github.com/ossrs/srs/pull/3416): GB: Support HEVC for regression test and load tool for GB. v6.0.29 (#3416)
|
* v6.0, 2023-02-25, Merge [#3416](https://github.com/ossrs/srs/pull/3416): GB: Support HEVC for regression test and load tool for GB. v6.0.29 (#3416)
|
||||||
* v6.0, 2023-02-25, Merge [#3424](https://github.com/ossrs/srs/pull/3424): API: Add service_id for http_hooks, which identify the process. v6.0.28 (#3424)
|
* v6.0, 2023-02-25, Merge [#3424](https://github.com/ossrs/srs/pull/3424): API: Add service_id for http_hooks, which identify the process. v6.0.28 (#3424)
|
||||||
* v6.0, 2023-02-22, Compatible with legacy RTMP URL. v6.0.27
|
* v6.0, 2023-02-22, Compatible with legacy RTMP URL. v6.0.27
|
||||||
|
|
|
@ -9,6 +9,6 @@
|
||||||
|
|
||||||
#define VERSION_MAJOR 6
|
#define VERSION_MAJOR 6
|
||||||
#define VERSION_MINOR 0
|
#define VERSION_MINOR 0
|
||||||
#define VERSION_REVISION 29
|
#define VERSION_REVISION 30
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -238,8 +238,8 @@ string srs_generate_stream_with_query(string host, string vhost, string stream,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove the start & when param is empty.
|
// Remove the start & and ? when param is empty.
|
||||||
query = srs_string_trim_start(query, "&");
|
query = srs_string_trim_start(query, "&?");
|
||||||
|
|
||||||
// Prefix query with ?.
|
// Prefix query with ?.
|
||||||
if (!query.empty() && !srs_string_starts_with(query, "?")) {
|
if (!query.empty() && !srs_string_starts_with(query, "?")) {
|
||||||
|
|
|
@ -3049,6 +3049,34 @@ VOID TEST(ProtocolRTMPTest, GenerateURL)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
VOID TEST(ProtocolRTMPTest, GenerateURLForFFmpeg)
|
||||||
|
{
|
||||||
|
// For https://github.com/ossrs/srs/issues/3405
|
||||||
|
if (true) {
|
||||||
|
string host("192.168.1.100"), vhost("localhost"), stream("stream"), param("?vhost=localhost");
|
||||||
|
string url = srs_generate_stream_with_query(host, vhost, stream, param, false);
|
||||||
|
EXPECT_STREQ("stream", url.c_str());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (true) {
|
||||||
|
string host("192.168.1.100"), vhost("localhost"), stream("stream"), param("?k=v&vhost=localhost");
|
||||||
|
string url = srs_generate_stream_with_query(host, vhost, stream, param, false);
|
||||||
|
EXPECT_STREQ("stream?k=v", url.c_str());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (true) {
|
||||||
|
string host("192.168.1.100"), vhost("localhost"), stream("stream"), param("?vhost=localhost&k=v");
|
||||||
|
string url = srs_generate_stream_with_query(host, vhost, stream, param, false);
|
||||||
|
EXPECT_STREQ("stream?k=v", url.c_str());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (true) {
|
||||||
|
string host("192.168.1.100"), vhost("localhost"), stream("stream"), param("?k=v");
|
||||||
|
string url = srs_generate_stream_with_query(host, vhost, stream, param, false);
|
||||||
|
EXPECT_STREQ("stream?k=v", url.c_str());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
VOID TEST(ProtocolRTMPTest, DiscoveryTcUrlLegacy)
|
VOID TEST(ProtocolRTMPTest, DiscoveryTcUrlLegacy)
|
||||||
{
|
{
|
||||||
if (true) {
|
if (true) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue