From c5f31570cd2954ca20eea547cd52a7eb18987c48 Mon Sep 17 00:00:00 2001 From: winlin Date: Mon, 23 Dec 2019 18:31:14 +0800 Subject: [PATCH] Support parsing vhost splited by single seperator. 2.0.268 --- README.md | 1 + trunk/src/core/srs_core.hpp | 2 +- trunk/src/protocol/srs_rtmp_utility.cpp | 1 + trunk/src/utest/srs_utest_protocol.cpp | 5 +++++ 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index e72f55032e..c282c30d8f 100755 --- a/README.md +++ b/README.md @@ -338,6 +338,7 @@ Remark: ## History +* v2.0, 2019-12-23, Fix [srs-librtmp #22](https://github.com/ossrs/srs-librtmp/issues/22), parse vhost splited by single seperator. 2.0.268 * v2.0, 2019-12-23, Fix [srs-librtmp #25](https://github.com/ossrs/srs-librtmp/issues/25), build srs-librtmp on windows. 2.0.267 * v2.0, 2019-12-13, Support openssl versions greater than 1.1.0. 2.0.266 * v2.0, 2019-11-29, [2.0 release7(2.0.265)][r2.0r7] released. 86994 lines. diff --git a/trunk/src/core/srs_core.hpp b/trunk/src/core/srs_core.hpp index 2ba1b4cb46..68600f5e58 100644 --- a/trunk/src/core/srs_core.hpp +++ b/trunk/src/core/srs_core.hpp @@ -31,7 +31,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // current release version #define VERSION_MAJOR 2 #define VERSION_MINOR 0 -#define VERSION_REVISION 267 +#define VERSION_REVISION 268 // generated by configure, only macros. #include diff --git a/trunk/src/protocol/srs_rtmp_utility.cpp b/trunk/src/protocol/srs_rtmp_utility.cpp index e37612d49f..8c9b9908ac 100644 --- a/trunk/src/protocol/srs_rtmp_utility.cpp +++ b/trunk/src/protocol/srs_rtmp_utility.cpp @@ -90,6 +90,7 @@ void srs_vhost_resolve(string& vhost, string& app, string& param) app = srs_string_replace(app, ",", "?"); app = srs_string_replace(app, "...", "?"); app = srs_string_replace(app, "&&", "?"); + app = srs_string_replace(app, "&", "?"); app = srs_string_replace(app, "=", "?"); if (srs_string_ends_with(app, "/_definst_")){ app = srs_erase_last_substr(app, "/_definst_"); diff --git a/trunk/src/utest/srs_utest_protocol.cpp b/trunk/src/utest/srs_utest_protocol.cpp index 119acfd3ba..77ac81752e 100644 --- a/trunk/src/utest/srs_utest_protocol.cpp +++ b/trunk/src/utest/srs_utest_protocol.cpp @@ -444,6 +444,11 @@ VOID TEST(ProtocolUtilityTest, VhostResolve) srs_vhost_resolve(vhost, app, param); EXPECT_STREQ("changed1", vhost.c_str()); EXPECT_STREQ("app", app.c_str()); + + app = "app?vhost=changed1&query=true"; + srs_vhost_resolve(vhost, app, param); + EXPECT_STREQ("changed1", vhost.c_str()); + EXPECT_STREQ("app", app.c_str()); app = "app?other=true&&vhost=changed2&&query=true"; srs_vhost_resolve(vhost, app, param);