1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-02-12 11:21:52 +00:00

Support parsing vhost splited by single seperator. 2.0.268

This commit is contained in:
winlin 2019-12-23 18:31:14 +08:00
parent 01a4503ceb
commit c5f31570cd
4 changed files with 8 additions and 1 deletions

View file

@ -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
* <strong>v2.0, 2019-11-29, [2.0 release7(2.0.265)][r2.0r7] released. 86994 lines.</strong>

View file

@ -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 <srs_auto_headers.hpp>

View file

@ -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_");

View file

@ -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);